Skip to Content
0
Former Member
Sep 10, 2007 at 01:14 PM

regarding reports

21 Views

hi experts,

i am trying to execute a report but it is givin runtime error ie &include incl_installation_error..m sending u full code..make changes whereever required

REPORT ZFI_R_RAMAN .

DATA: BEGIN OF ITAB OCCURS 0,

ORDER(3) TYPE C,

MAT(5) TYPE C,

CD TYPE C,

QTY(5) TYPE C,

CQUAN(8) TYPE P DECIMALS 2,

DQUAN(8) TYPE P DECIMALS 2,

CRATE(8) TYPE P DECIMALS 2,

DRATE(8) TYPE P DECIMALS 2,

SUM(16) TYPE P DECIMALS 2,

RATE(8) TYPE P DECIMALS 3,

VALUE(13) TYPE P DECIMALS 3,

END OF ITAB.

DATA: WCREDIT LIKE ITAB-QTY,

WDEBIT LIKE ITAB-QTY,

WACREDIT LIKE ITAB-VALUE,

WADEBIT LIKE ITAB-VALUE,

DATA: WCREDIT1(15) type c,

WDEBIT1(15) type c,

WACREDIT1(15) type c,

WADEBIT1(15) type c,

wasum(15) type c.

ITAB-ORDER = '01'.

ITAB-MAT = 'MA'.

ITAB-CD = 'H'.

ITAB-QTY = '2'.

ITAB-RATE = '1.8'.

ITAB-VALUE = ITAB-QTY * ITAB-RATE.

APPEND ITAB.

ITAB-ORDER = '02'.

ITAB-MAT = 'MA'.

ITAB-CD = 'S'.

ITAB-QTY = '1'.

ITAB-RATE = '1.7'.

ITAB-VALUE = ITAB-QTY * ITAB-RATE.

APPEND ITAB.

ITAB-ORDER = '03'.

ITAB-MAT = 'MA'.

ITAB-CD = 'H'.

ITAB-QTY = '3'.

ITAB-RATE = '1.8'.

ITAB-VALUE = ITAB-QTY * ITAB-RATE.

APPEND ITAB.

ITAB-ORDER = '04'.

ITAB-MAT = 'SA'.

ITAB-CD = 'H'.

ITAB-QTY = '4'.

ITAB-RATE = '1.9'.

ITAB-VALUE = ITAB-QTY * ITAB-RATE.

APPEND ITAB.

ITAB-ORDER = '05'.

ITAB-MAT = 'SA'.

ITAB-CD = 'S'.

ITAB-QTY = '4'.

ITAB-RATE = '20.0'.

ITAB-VALUE = ITAB-QTY * ITAB-RATE.

APPEND ITAB.

ITAB-ORDER = '06'.

ITAB-MAT = 'MA'.

ITAB-CD = 'S'.

ITAB-QTY = '2'.

ITAB-RATE = '4.0'.

ITAB-VALUE = ITAB-QTY * ITAB-RATE.

APPEND ITAB.

ITAB-ORDER = '07'.

ITAB-MAT = 'SA'.

ITAB-CD = 'H'.

ITAB-QTY = '3'.

ITAB-RATE = '5.0'.

ITAB-VALUE = ITAB-QTY * ITAB-RATE.

APPEND ITAB.

ITAB-ORDER = '08'.

ITAB-MAT = 'JA'.

ITAB-CD = 'H'.

ITAB-QTY = '2'.

ITAB-RATE = '1.8'.

ITAB-VALUE = ITAB-QTY * ITAB-RATE.

APPEND ITAB.

ITAB-ORDER = '09'.

ITAB-MAT = 'JA'.

ITAB-CD = 'S'.

ITAB-QTY = '2'.

ITAB-RATE = '1.8'.

ITAB-VALUE = ITAB-QTY * ITAB-RATE.

APPEND ITAB.

SORT ITAB BY MAT.

LOOP AT ITAB.

IF ITAB-CD = 'H'.

WCREDIT = WCREDIT + ITAB-QTY.

WACREDIT = WACREDIT + ITAB-VALUE.

ELSEIF ITAB-CD = 'S'.

WDEBIT = WDEBIT + ITAB-QTY.

WADEBIT = WADEBIT + ITAB-VALUE.

ENDIF.

ITAB-CQUAN = WCREDIT.

ITAB-DQUAN = WDEBIT.

ITAB-CRATE = WACREDIT.

ITAB-DRATE = WADEBIT.

ITAB-SUM = ITAB-CRATE - ITAB-DRATE.

AT END OF MAT.

APPEND ITAB.

CLEAR: WACREDIT,WADEBIT,WCREDIT,WDEBIT.

ENDAT.

ENDLOOP.

WRITE:/ 'matno', SPACE,SPACE,SPACE, 'crqty',32 'dbqty',50 'crvalue',65'dbvalue', 74 'sum'.

LOOP AT ITAB.

*on change of itab-mat.

WCREDIT = ITAB-CQUAN.

WDEBIT = ITAB-DQUAN.

WACREDIT = ITAB-CRATE.

WADEBIT = ITAB-DRATE.

WASUM = ITAB-SUM.

WRITE:/ ITAB-MAT,WCREDIT,WDEBIT,WACREDIT,WADEBIT,WASUM.

AT LAST.

SUM.

SKIP 2.

WRITE:/65 'total sum', 74 ITAB-SUM.

ENDAT.

CLEAR WASUM.

ENDLOOP.