REPORT ZVA_INVOICE_INTR_REP.
TABLES: RBKP,
RSEG.
TYPES: BEGIN OF ST_RBKP,
BELNR TYPE RE_BELNR,
GJAHR TYPE GJAHR,
BLART TYPE BLART,
BLDAT TYPE BLDAT,
END OF ST_RBKP,
BEGIN OF ST_RSEG,
BELNR TYPE RE_BELNR,
GJHAR TYPE GJAHR,
BUZEI type RBLGP,
EBELN TYPE EBELN,
END OF ST_RSEG.
DATA: IT_RBKP TYPE STANDARD TABLE OF ST_RBKP,
IT_RSEG TYPE STANDARD TABLE OF ST_RSEG,
WA_RBKP TYPE ST_RBKP,
WA_RSEG TYPE ST_RSEG.
SELECT-OPTIONS: S_BELNR FOR RBKP-BELNR.
SELECT BELNR
GJAHR
BLART
BLDAT FROM RBKP INTO TABLE IT_RBKP
WHERE BELNR IN S_BELNR.
LOOP AT IT_RBKP INTO WA_RBKP.
WRITE: / WA_RBKP-BELNR,
WA_RBKP-GJAHR,
WA_RBKP-BLART,
WA_RBKP-BLDAT.
HIDE WA_RBKP-BELNR.
ENDLOOP.
AT LINE-SELECTION.
CASE SY-LSIND.
WHEN '1'.
SELECT BELNR GJAHR BUZEI EBELN FROM RSEG
INTO TABLE IT_RSEG
WHERE BELNR = WA_RBKP-BELNR.
LOOP AT IT_RSEG INTO WA_RSEG.
WRITE: / WA_RSEG-BELNR,
WA_RSEG-GJHAR,
WA_RSEG-BUZEI,
WA_RSEG-EBELN.
ENDLOOP.
ENDCASE.
Serkan AKKAVAK
Computer Engineer
ABAP Developer & SAP S/4 HANA Logistics Team Lead
Contact : serkurumsal@yandex.com
Social Plugin