REPORT ZINNER_JOIN_EKKO_EKPO.
TYPES: BEGIN OF ekpo_with_ekko,
ebeln TYPE ekpo-ebeln,
bukrs TYPE ekko-bukrs,
bstyp TYPE ekko-bstyp,
matnr TYPE ekpo-matnr,
werks TYPE ekpo-werks,
matkl TYPE ekpo-matkl,
END OF ekpo_with_ekko.
DATA: lt_result TYPE TABLE OF ekpo_with_ekko,
ls_result TYPE ekpo_with_ekko.
SELECT ekpo~ebeln AS ebeln ekko~bukrs AS bukrs ekko~bstyp AS bstyp ekpo~matnr AS matnr ekpo~werks AS werks ekpo~matkl AS matkl
FROM ekpo
INNER JOIN ekko ON ekpo~ebeln = ekko~ebeln
INTO TABLE lt_result.
IF lt_result IS NOT INITIAL.
LOOP AT lt_result INTO ls_result.
WRITE: / 'EBELN:', ls_result-ebeln,
'BUKRS:', ls_result-bukrs,
'BSTYP:', ls_result-bstyp,
'MATNR:', ls_result-matnr,
'WERKS:', ls_result-werks,
'MATKL:', ls_result-matkl.
ENDLOOP.
ELSE.
WRITE: / 'No records found for the specified criteria.'.
ENDIF.
0 Comments