Code: Alles auswählen.
INITIALIZATION.
*Struktur für interne Tabelle
TYPES: BEGIN OF l_s_kreditor,
krednr LIKE LFA1-LIFNR,
kredname LIKE LFA1-NAME1,
matnr LIKE EKPO-MATNR,
redat LIKE RBKP-REINDAT,
budat LIKE RBKP-BUDAT,
rmwwr LIKE RBKP-RMWWR,
END OF l_s_kreditor.
* TYPES: l_t_kreditor TYPE TABLE OF l_s_kreditor.
*Initialisierung interne Tabelle
DATA l_t_kreditor TYPE TABLE OF l_s_kreditor WITH HEADER LINE.
*Selection Kreditor
DATA wa_LFA1 TYPE LFA1.
SELECT-OPTIONS Kreditor FOR wa_LFA1-LIFNR.
*selection Materialnummer
PARAMETERS: Artikel TYPE EKPO-MATNR.
*Selection DATUM TYPE d.
DATA wa_RBKP TYPE RBKP.
SELECT-OPTIONS Datum FOR wa_RBKP-BUDAT.
AT SELECTION-SCREEN.
START-OF-SELECTION.
*Main Select
IF Kreditor IS NOT INITIAL AND Artikel IS INITIAL AND Datum IS INITIAL.
SELECT LFA1~LIFNR
LFA1~NAME1
EKPO~MATNR
RBKP~REINDAT
RBKP~BUDAT
RBKP~RMWWR INTO CORRESPONDING FIELDS OF TABLE l_t_kreditor
FROM RBKP
INNER JOIN LFA1
ON RBKP~LIFNR = LFA1~LIFNR
INNER JOIN EKKO
ON RBKP~LIFNR = EKKO~LIFNR
INNER JOIN EKPO
ON EKPO~EBELN = EKKO~EBELN
WHERE LFA1~LIFNR = Kreditor.
Code: Alles auswählen.
SELECT LFA1~LIFNR
LFA1~NAME1
EKPO~MATNR
RBKP~REINDAT
RBKP~BUDAT
RBKP~RMWWR INTO CORRESPONDING FIELDS OF TABLE l_t_kreditor
FROM LFA1
INNER JOIN RBKP
ON RBKP~LIFNR = LFA1~LIFNR
INNER JOIN EKKO
ON EKKO~LIFNR = LFA1~LIFNR
INNER JOIN EKPO
ON EKPO~EBELN = EKKO~EBELN
WHERE LFA1~LIFNR = Kreditor.
Code: Alles auswählen.
WHERE LFA1~LIFNR = Kreditor.
Code: Alles auswählen.
WHERE LFA1~LIFNR IN Kreditor.