Code: Alles auswählen.
" Bsp.: name = 'SY-UNAME'.
ASSIGN name TO <fs_field>. " <fs_field> beinhaltet 'SY-UNAME'.
ASSIGN (name) TO <fs_field>. " <fs_field> beinhaltet den Inhalt von SY-UNAME.
Code: Alles auswählen.
REPORT z_sandbox_ma.
DATA: BEGIN OF wa_struktur,
tag00 TYPE c LENGTH 5,
tag01 TYPE n LENGTH 10,
tag02 TYPE i,
END OF wa_struktur,
ge_struct TYPE string,
ge_comp TYPE string.
FIELD-SYMBOLS <fs_field> TYPE any.
START-OF-SELECTION.
ge_struct = 'WA_STRUKTUR'.
ge_comp = 'TAG00'.
wa_struktur-tag00 = 'Test!'.
CONCATENATE ge_struct '-' ge_comp INTO ge_struct.
ASSIGN (ge_struct) TO <fs_field>.
Code: Alles auswählen.
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE wa_struktur TO <fs_field>.
IF sy-subrc NE 0.
EXIT.
ENDIF.
WRITE / <fs_field>.
ENDDO.