Code: Alles auswählen.
Data: l_obj_struct TYPE REF TO cl_abap_structdescr.
FIELD-SYMBOLS <l_wrk_compdescr> TYPE abap_compdescr.
FIELD-SYMBOLS <l_wa_data> TYPE ANY.
FIELD-SYMBOLS <l_it_data> TYPE ANY TABLE.
FIELD-SYMBOLS <help> TYPE ANY.
LOOP AT <l_it_data> ASSIGNING <l_wa_data>.
* Struktur des Arbeitsbereiches ermitteln
l_obj_struct ?= cl_abap_typedescr=>describe_by_data( <l_wa_data> ).
IF sy-subrc <> 0.
* RAISE structure_not_found.
ENDIF.
* Die einzelnen Felder zu einem String zusammenfügen
LOOP AT l_obj_struct->components ASSIGNING <l_wrk_compdescr>.
ASSIGN COMPONENT sy-tabix OF STRUCTURE <l_wa_data> TO <help>.
* Überprüfen was für ein Feldtyp geschrieben wird
IF <l_wrk_compdescr>-type_kind = 'C'.
CONCATENATE '''' <help> '''' INTO <help>.
ENDIF.
* Inhalt des Arbeitsbereiches in einen String schreiben
IF sy-tabix = 1.
MOVE <help> TO l_str_inhalt.
ELSE.
CONCATENATE l_str_inhalt <help> INTO l_str_inhalt
SEPARATED BY ','.
ENDIF.
ENDLOOP.
endloop.
Code: Alles auswählen.
LOOP AT <my_table> ASSIGNING <struct>.
LOOP AT itab_fieldcatalog INTO gs_fieldcatalog.
ASSIGN COMPONENT gs_fieldcatalog-fieldname OF STRUCTURE <struct>
TO <feld>.
IF gs_fieldcatalog-fieldname = 'MATNR'.
MOVE gs_test-matnr TO <feld>.
ENDIF.
IF gs_fieldcatalog-fieldname = 'VBELN'.
MOVE gs_test-vbeln TO <feld>.
ENDIF.
...
ENDLOOP.
ENDLOOP.