Program:
REPORT ZSM_MARA2.
TYPES: BEGIN OF str1,
vbeln TYPE vbeln,
waerk TYPE waerk,
netwr TYPE netwr,
vkorg TYPE vkorg,
END OF str1.
TYPES: BEGIN OF str2,
vbeln TYPE vbeln,
posnr TYPE posnr,
matnr TYPE matnr,
matkl TYPE matkl,
END OF str2.
DATA: it_one TYPE STANDARD TABLE OF str1,
wa_one TYPE str1.
DATA: it_two TYPE STANDARD TABLE OF str2,
wa_two TYPE str2.
SELECT vbeln waerk netwr vkorg FROM vbak INTO TABLE it_one.
LOOP AT it_one INTO wa_one.
WRITE:/ wa_one-vbeln, wa_one-waerk, wa_one-netwr, wa_one-vkorg.
hide wa_one-vbeln.
ENDLOOP.
AT LINE-SELECTION.
SELECT vbeln posnr matnr matkl
FROM vbap INTO TABLE it_two WHERE vbeln = wa_one-vbeln.
IF sy-subrc = 0.
loop at it_two INTO wa_two.
WRITE:/ wa_two-vbeln, wa_two-posnr, wa_two-matnr, wa_two-matkl.
ENDLOOP.
ENDIF.
Output:
0 Comments