Report with Events
REPORT ZREPORT9.
TABLES: VBAP.
TYPES: BEGIN OF TY_VBAP,
VBELN TYPE VBAP-VBELN,
POSNR TYPE VBAP-POSNR,
MATNR TYPE VBAP-MATNR,
NETWR TYPE VBAP-NETWR,
END OF TY_VBAP.
DATA: I_VBAP TYPE TABLE OF TY_VBAP.
DATA: WA_VBAP TYPE TY_VBAP.
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: VBELN FOR VBAP-VBELN.
SELECTION-SCREEN: END OF BLOCK B1.
SELECT VBELN POSNR MATNR NETWR FROM VBAP INTO TABLE I_VBAP.
LOOP AT I_VBAP INTO WA_VBAP.
AT FIRST.
ULINE.
WRITE:/ 'SALES ORDER DOCUMENT' COLOR 5 INTENSIFIED.
ULINE.
ENDAT.
AT NEW VBELN.
WRITE: /2'SALES DOC NUMBER' COLOR 2, 18 WA_VBAP-VBELN COLOR 7 INTENSIFIED.
ENDAT.
WRITE: /2 WA_VBAP-VBELN ,22 WA_VBAP-POSNR, 44 WA_VBAP-MATNR, 55 WA_VBAP-NETWR.
*SKIP.
* ULINE AT 2(63).
AT END OF VBELN.
*ULINE AT 2(80).
*SKIP.
SUM.
WRITE: /40(52) 'SUBTOTAL IS:' COLOR 3, 55 WA_VBAP-NETWR COLOR 3.
*SKIP.
*ULINE AT 2(80).
ENDAT.
AT LAST.
ULINE AT 2(1000).
*SKIP.
SUM.
WRITE: /40(52)'GRAND TOTAL IS:' COLOR 1, 55 WA_VBAP-NETWR COLOR 6.
SKIP.
ULINE AT 2(100).
ENDAT.
ENDLOOP.
TABLES: VBAP.
TYPES: BEGIN OF TY_VBAP,
VBELN TYPE VBAP-VBELN,
POSNR TYPE VBAP-POSNR,
MATNR TYPE VBAP-MATNR,
NETWR TYPE VBAP-NETWR,
END OF TY_VBAP.
DATA: I_VBAP TYPE TABLE OF TY_VBAP.
DATA: WA_VBAP TYPE TY_VBAP.
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: VBELN FOR VBAP-VBELN.
SELECTION-SCREEN: END OF BLOCK B1.
SELECT VBELN POSNR MATNR NETWR FROM VBAP INTO TABLE I_VBAP.
LOOP AT I_VBAP INTO WA_VBAP.
AT FIRST.
ULINE.
WRITE:/ 'SALES ORDER DOCUMENT' COLOR 5 INTENSIFIED.
ULINE.
ENDAT.
AT NEW VBELN.
WRITE: /2'SALES DOC NUMBER' COLOR 2, 18 WA_VBAP-VBELN COLOR 7 INTENSIFIED.
ENDAT.
WRITE: /2 WA_VBAP-VBELN ,22 WA_VBAP-POSNR, 44 WA_VBAP-MATNR, 55 WA_VBAP-NETWR.
*SKIP.
* ULINE AT 2(63).
AT END OF VBELN.
*ULINE AT 2(80).
*SKIP.
SUM.
WRITE: /40(52) 'SUBTOTAL IS:' COLOR 3, 55 WA_VBAP-NETWR COLOR 3.
*SKIP.
*ULINE AT 2(80).
ENDAT.
AT LAST.
ULINE AT 2(1000).
*SKIP.
SUM.
WRITE: /40(52)'GRAND TOTAL IS:' COLOR 1, 55 WA_VBAP-NETWR COLOR 6.
SKIP.
ULINE AT 2(100).
ENDAT.
ENDLOOP.
No comments:
Post a Comment