Skip to Content
0
Former Member
Jul 12, 2007 at 08:10 AM

DiSplaying Records

15 Views

Hi,

This is my program.

I wnat to display top3 records, records which are at odd position and top3 records with highest salary.

REPORT ZAC_TAB10.

*LINE TYPE:

TYPES:

BEGIN OF TY_EMP,

EMPID(4) TYPE N,

ENAME(20) TYPE C,

DEPT(4) TYPE C,

SALARY TYPE I,

END OF TY_EMP.

DATA:

FS_EMP TYPE TY_EMP,

IT_EMP TYPE TABLE OF TY_EMP.

FS_EMP-EMPID = 1010.

FS_EMP-ENAME = 'XX'.

FS_EMP-DEPT = 'D100'.

FS_EMP-SALARY = 10000.

APPEND FS_EMP TO IT_EMP.

FS_EMP-EMPID = 1011.

FS_EMP-ENAME = 'YY'.

FS_EMP-DEPT = 'D100'.

FS_EMP-SALARY = 11000.

APPEND FS_EMP TO IT_EMP.

FS_EMP-EMPID = 1001.

FS_EMP-ENAME = 'ZZ'.

FS_EMP-DEPT = 'D200'.

FS_EMP-SALARY = 12000.

APPEND FS_EMP TO IT_EMP.

FS_EMP-EMPID = 1008.

FS_EMP-ENAME = 'XY'.

FS_EMP-DEPT = 'D200'.

FS_EMP-SALARY = 10000.

APPEND FS_EMP TO IT_EMP.

FS_EMP-EMPID = 1002.

FS_EMP-ENAME = 'XZ'.

FS_EMP-DEPT = 'D300'.

FS_EMP-SALARY = 8000.

APPEND FS_EMP TO IT_EMP.

FS_EMP-EMPID = 1005.

FS_EMP-ENAME = 'YX'.

FS_EMP-DEPT = 'D300'.

FS_EMP-SALARY = 9500.

APPEND FS_EMP TO IT_EMP.

FS_EMP-EMPID = 1002.

FS_EMP-ENAME = 'YZ'.

FS_EMP-DEPT = 'D300'.

FS_EMP-SALARY = 9500.

APPEND FS_EMP TO IT_EMP.

FS_EMP-EMPID = 1007.

FS_EMP-ENAME = 'AA'.

FS_EMP-DEPT = 'D100'.

FS_EMP-SALARY = 10500.

APPEND FS_EMP TO IT_EMP.

FS_EMP-EMPID = 1003.

FS_EMP-ENAME = 'BB'.

FS_EMP-DEPT = 'D200'.

FS_EMP-SALARY = 12000.

APPEND FS_EMP TO IT_EMP.

FS_EMP-EMPID = 1006.

FS_EMP-ENAME = 'CC'.

FS_EMP-DEPT = 'D100'.

FS_EMP-SALARY = 15000.

APPEND FS_EMP TO IT_EMP.

LOOP AT IT_EMP INTO FS_EMP.

WRITE:/ FS_EMP-EMPID,FS_EMP-ENAME,FS_EMP-DEPT,FS_EMP-SALARY.