Google Search - Blog...........

Insert Internal Table Data To The Dynamically Created Table

REPORT zTEST.

DATA: lt_mara TYPE TABLE OF mara,
ls_mara TYPE mara.

DATA: lr_dref TYPE REF TO data.
DATA: lv_tabname TYPE tabname.

FIELD-SYMBOLS: TYPE table,
TYPE ANY.

lv_tabname = 'MARA'.

TRY.

CREATE DATA lr_dref TYPE TABLE OF (lv_tabname).
ASSIGN lr_dref->* TO .

CATCH cx_sy_create_data_error.
* Do something

ENDTRY.


SELECT * FROM mara INTO TABLE lt_mara.

LOOP AT lt_mara INTO ls_mara.
ASSIGN ls_mara TO .
APPEND TO .
ENDLOOP.

No comments:

Post a Comment