Program:
REPORT zsm_interactive.
TYPES: BEGIN OF str1,
matnr TYPE matnr,
mtart TYPE mtart,
meins TYPE meins,
END OF str1.
TYPES: BEGIN OF str2,
matnr TYPE matnr,
maktx TYPE maktx,
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 matnr mtart meins FROM mara INTO TABLE it_one UP TO 10 ROWS.
LOOP AT it_one INTO wa_one.
WRITE:/ wa_one-matnr, wa_one-mtart, wa_one-meins.
hide wa_one-matnr.
ENDLOOP.
AT LINE-SELECTION.
SELECT matnr maktx
FROM makt INTO TABLE it_two WHERE matnr = wa_one-matnr.
IF sy-subrc = 0.
loop at it_two INTO wa_two.
WRITE:/ wa_two-matnr, wa_two-maktx.
ENDLOOP.
ENDIF.
Output:
0 Comments