First Program Code :
REPORT zvp_a.
TYPES: BEGIN OF ty_mara,
matnr TYPE mara-matnr,
mtart TYPE mara-mtart,
matkl TYPE mara-matkl,
END OF ty_mara.
DATA: it TYPE STANDARD TABLE OF ty_mara.
SELECT matnr
mtart
matkl
FROM mara INTO TABLE it
UP TO 10 ROWS.
PERFORM display IN PROGRAM zvp_b IF FOUND
TYPES: BEGIN OF ty_mara,
matnr TYPE mara-matnr,
mtart TYPE mara-mtart,
matkl TYPE mara-matkl,
END OF ty_mara.
DATA: it TYPE STANDARD TABLE OF ty_mara.
SELECT matnr
mtart
matkl
FROM mara INTO TABLE it
UP TO 10 ROWS.
PERFORM display IN PROGRAM zvp_b IF FOUND
Second Program Code :
REPORT zvp_b.
TYPES: BEGIN OF ty_mara,
matnr TYPE mara-matnr,
mtart TYPE mara-mtart,
matkl TYPE mara-matkl,
END OF ty_mara.
DATA: wa TYPE ty_mara.
PERFORM display.
FORM display.
DATA: lv_tname TYPE c LENGTH 30.
FIELD-SYMBOLS : <table> TYPE ANY TABLE.
MOVE '(ZVP_A)IT' TO lv_tname.
ASSIGN (lv_tname) TO <table>.
LOOP AT <table> INTO wa.
write:/ wa-matnr,
wa-mtart,
wa-matkl.
ENDLOOP.
ENDFORM.
TYPES: BEGIN OF ty_mara,
matnr TYPE mara-matnr,
mtart TYPE mara-mtart,
matkl TYPE mara-matkl,
END OF ty_mara.
DATA: wa TYPE ty_mara.
PERFORM display.
FORM display.
DATA: lv_tname TYPE c LENGTH 30.
FIELD-SYMBOLS : <table> TYPE ANY TABLE.
MOVE '(ZVP_A)IT' TO lv_tname.
ASSIGN (lv_tname) TO <table>.
LOOP AT <table> INTO wa.
write:/ wa-matnr,
wa-mtart,
wa-matkl.
ENDLOOP.
ENDFORM.
Execute ZVP_A Program.
Output :
Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us. We will reply you as soon as possible.
Post a Comment