*&---------------------------------------------------------------------*
*& Report ZR_INTEACTIVE_REPORT1
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZR_INTEACTIVE_REPORT1.
TABLES: KNA1,VBAK,VBAP.
*************************** type declaration ****************
TYPES: BEGIN OF ST_VBAK,
VBELN TYPE VBAK-VBELN,
ERDAT TYPE VBAK-ERDAT,
AUART TYPE VBAK-AUART,
KUNNR TYPE VBAK-KUNNR,
END OF ST_VBAK.
TYPES: BEGIN OF ST_KNA1,
KUNNR TYPE KNA1-KUNNR,
NAME1 TYPE KNA1-NAME1,
LAND1 TYPE KNA1-LAND1,
ORT01 TYPE KNA1-ORT01,
END OF ST_KNA1.
TYPES: BEGIN OF ST_VBAP,
VBELN TYPE VBAP-VBELN,
POSNR TYPE VBAP-POSNR,
MATNR TYPE VBAP-MATNR,
NETWR TYPE VBAP-NETWR,
END OF ST_VBAP.
********************internal table******************************
DATA: IT_VBAP TYPE TABLE OF ST_VBAP,
WA_VBAP TYPE ST_VBAP,
WA_VBAK TYPE ST_VBAK,
WA_KNA1 TYPE ST_KNA1.
************************ selection screen statement **************
SELECT-OPTIONS: S_VBELN FOR VBAP-VBELN.
************************basic list *********************************
START-OF-SELECTION.
SELECT VBELN POSNR MATNR NETWR FROM VBAP INTO TABLE IT_VBAP WHERE VBELN IN S_VBELN.
WRITE: / 'salse doc item details'.
SKIP 1.
LOOP AT IT_VBAP INTO WA_VBAP.
WRITE: / WA_VBAP-VBELN COLOR 1 HOTSPOT,WA_VBAP-POSNR, WA_VBAP-MATNR, WA_VBAP-NETWR.
HIDE: WA_VBAP-VBELN.
ENDLOOP.
************************secondary list **********************************
AT LINE-SELECTION.
CASE SY-LSIND.
WHEN 1.
SELECT SINGLE VBELN ERDAT AUART KUNNR FROM VBAK INTO WA_VBAK WHERE VBELN = WA_VBAP-VBELN.
WRITE: / 'salse doc header details'.
SKIP 1.
WRITE: / WA_VBAK-VBELN, WA_VBAK-ERDAT, WA_VBAK-AUART, WA_VBAK-KUNNR COLOR 2 HOTSPOT.
HIDE: WA_VBAK-KUNNR.
WHEN 2.
WINDOW STARTING AT 10 10 ENDING AT 50 10.
SELECT SINGLE KUNNR NAME1 LAND1 ORT01 FROM KNA1 INTO WA_KNA1 WHERE KUNNR = WA_VBAK-KUNNR.
WRITE: / 'customer details'.
WRITE: / WA_KNA1-KUNNR, WA_KNA1-NAME1, WA_KNA1-LAND1, WA_KNA1-ORT01.
ENDCASE.
RESULT:
*& Report ZR_INTEACTIVE_REPORT1
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZR_INTEACTIVE_REPORT1.
TABLES: KNA1,VBAK,VBAP.
*************************** type declaration ****************
TYPES: BEGIN OF ST_VBAK,
VBELN TYPE VBAK-VBELN,
ERDAT TYPE VBAK-ERDAT,
AUART TYPE VBAK-AUART,
KUNNR TYPE VBAK-KUNNR,
END OF ST_VBAK.
TYPES: BEGIN OF ST_KNA1,
KUNNR TYPE KNA1-KUNNR,
NAME1 TYPE KNA1-NAME1,
LAND1 TYPE KNA1-LAND1,
ORT01 TYPE KNA1-ORT01,
END OF ST_KNA1.
TYPES: BEGIN OF ST_VBAP,
VBELN TYPE VBAP-VBELN,
POSNR TYPE VBAP-POSNR,
MATNR TYPE VBAP-MATNR,
NETWR TYPE VBAP-NETWR,
END OF ST_VBAP.
********************internal table******************************
DATA: IT_VBAP TYPE TABLE OF ST_VBAP,
WA_VBAP TYPE ST_VBAP,
WA_VBAK TYPE ST_VBAK,
WA_KNA1 TYPE ST_KNA1.
************************ selection screen statement **************
SELECT-OPTIONS: S_VBELN FOR VBAP-VBELN.
************************basic list *********************************
START-OF-SELECTION.
SELECT VBELN POSNR MATNR NETWR FROM VBAP INTO TABLE IT_VBAP WHERE VBELN IN S_VBELN.
WRITE: / 'salse doc item details'.
SKIP 1.
LOOP AT IT_VBAP INTO WA_VBAP.
WRITE: / WA_VBAP-VBELN COLOR 1 HOTSPOT,WA_VBAP-POSNR, WA_VBAP-MATNR, WA_VBAP-NETWR.
HIDE: WA_VBAP-VBELN.
ENDLOOP.
************************secondary list **********************************
AT LINE-SELECTION.
CASE SY-LSIND.
WHEN 1.
SELECT SINGLE VBELN ERDAT AUART KUNNR FROM VBAK INTO WA_VBAK WHERE VBELN = WA_VBAP-VBELN.
WRITE: / 'salse doc header details'.
SKIP 1.
WRITE: / WA_VBAK-VBELN, WA_VBAK-ERDAT, WA_VBAK-AUART, WA_VBAK-KUNNR COLOR 2 HOTSPOT.
HIDE: WA_VBAK-KUNNR.
WHEN 2.
WINDOW STARTING AT 10 10 ENDING AT 50 10.
SELECT SINGLE KUNNR NAME1 LAND1 ORT01 FROM KNA1 INTO WA_KNA1 WHERE KUNNR = WA_VBAK-KUNNR.
WRITE: / 'customer details'.
WRITE: / WA_KNA1-KUNNR, WA_KNA1-NAME1, WA_KNA1-LAND1, WA_KNA1-ORT01.
ENDCASE.
RESULT:
No comments:
Post a Comment