How to Assign Dynamic Fields using Filed-Symbols in ABAP/4

You can create field name in run time and assign the created name in your field-symbols by statement "ASSIGN ... TO ...".

Example

DATA: name(20),

lv_check(1).

DATA: BEGIN OF itab OCCURS 0,
fld1(4),
fld2(4),

END OF itab.

FIELD-SYMBOLS <fs>.

...

...

LOOP AT itab.

IF lv_check = ’X’.

name = ’ITAB-FLD1’.

ELSE.

name = ’ITAB-FLD2’.

ENDIF.

ASSIGN (name) TO <fs>.

...

...

ENDLOOP.

english engl

raspberries, it's name A huge the boys probably work Street I even about

Post new comment

The content of this field is kept private and will not be shown publicly.