Code: Alles auswählen.
cl_struc ?= cl_abap_datadescr=>describe_by_data( p_data = gs_struc ).
LOOP AT cl_struc->components ASSIGNING <fs_comps>.
assign <fs_comps-name to <field>
substruc-(<field>) = 'Test'.
ENDLOOP.
Code: Alles auswählen.
REPORT.
DATA: cl_struc TYPE REF TO cl_abap_structdescr.
cl_struc ?= cl_abap_structdescr=>describe_by_data( p_data = syst ).
LOOP AT cl_struc->components ASSIGNING FIELD-SYMBOL(<component>).
DATA(lv_fieldname) = |SYST-{ <component>-name }|.
ASSIGN (lv_fieldname) TO FIELD-SYMBOL(<field>).
WRITE:/ <component>-name, AT 10 <field>.
ENDLOOP.
Code: Alles auswählen.
REPORT.
DATA: cl_struc TYPE REF TO cl_abap_structdescr.
cl_struc ?= cl_abap_structdescr=>describe_by_data( p_data = syst ).
LOOP AT cl_struc->components ASSIGNING FIELD-SYMBOL(<component>).
assign COMPONENT <component>-name of STRUCTURE syst to FIELD-SYMBOL(<field>).
WRITE:/ <component>-name, AT 10 <field>.
ENDLOOP.
Code: Alles auswählen.
DATA: cl_struc TYPE REF TO cl_abap_structdescr.
FIELD-SYMBOLS <component> TYPE abap_compdescr.
FIELD-SYMBOLS <field> type any.
cl_struc ?= cl_abap_structdescr=>describe_by_data( p_data = syst ).
LOOP AT cl_struc->components ASSIGNING (<component>).
assign COMPONENT <component>-name of STRUCTURE syst to (<field>).
WRITE:/ <component>-name, AT 10 <field>.
ENDLOOP.
Code: Alles auswählen.
DATA: cl_struc TYPE REF TO cl_abap_structdescr.
cl_struc ?= cl_abap_structdescr=>describe_by_data( p_data = syst ).
LOOP AT cl_struc->components ASSIGNING FIELD-SYMBOL(<component>).
ASSIGN COMPONENT <component>-name OF STRUCTURE syst TO FIELD-SYMBOL(<field>).
WRITE:/ <component>-name, AT 10 <field>.
ENDLOOP.