How to Read Table Dynamically in ABAP/4

About statement "READ TABLE", we can generate code for read key dynamic as below:


DATA: BEGIN OF itab OCCURS 0,
fld1(2),
fld2(2),
fld3(10),
fld4 TYPE i,
END OF itab,
wa_tab LIKE itab,
gv_key1(4) TYPE C VALUE ’FLD1’,
gv_key2(4) TYPE C VALUE ’FLD2’.
...
...
...

READ TABLE itab INTO wa_tab
WITH KEY (gv_key1) = ’AA’
(gv_key2) = ’BB’.

Post new comment