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

Appending & Modifying A Dynamic Table Data.

REPORT ztest_001.

PARAMETER: p_table TYPE tabname DEFAULT 'MARD'.

DATA: dref TYPE REF TO data.

FIELD-SYMBOLS:
TYPE STANDARD TABLE, "Dyn. Int. Table
TYPE ANY, "Work Area
TYPE ANY.

*Create the data reference for internal table
CREATE DATA dref TYPE STANDARD TABLE OF (p_table).

*De-referencing the data reference variable
ASSIGN dref->* TO .
CLEAR dref.

* Create data reference for work area
CREATE DATA dref TYPE (p_table).
ASSIGN dref->* TO .

DO.
ASSIGN COMPONENT sy-index OF STRUCTURE TO .
IF sy-subrc = 0.
= 'Value'.
ELSE.
APPEND TO .
CLEAR .
EXIT.
ENDIF.
ENDDO.

start-of-selection.


LOOP AT INTO .
WRITE:/ .
ENDLOOP.

No comments:

Post a Comment