* Daten holen
SELECT carrid, connid, fldate, price, currency, planetype
INTO TABLE @DATA(it_sflight)
FROM sflight .
* Table: Beschreibung
DATA(o_tdesc) = CAST cl_abap_tabledescr( cl_abap_tabledescr=>describe_by_data( it_sflight ) ).
* Row: Beschreibung
DATA(o_sdesc) = CAST cl_abap_structdescr( o_tdesc->get_table_line_type( ) ).
* Col: Komponenten (Felder) -> DFIES: DD-Schnittstelle: Tabellenfelder für DDIF_FIELDINFO_GET
DATA(it_com) = o_sdesc->get_components( ).
* Header
LOOP AT it_com ASSIGNING FIELD-SYMBOL(<c>).
* Prüfen, ob DDIC-Typ, damit die Metadaten ausgelesen werden können
DATA(o_edesc) = CAST cl_abap_elemdescr( <c>-type ).
IF o_edesc->is_ddic_type( ) EQ abap_true.
DATA(lv_dfies) = o_edesc->get_ddic_field( ).
* technischer Name
* WRITE: |{ <c>-name WIDTH = lv_dfies-scrlen3 }|.
* Langtext des Feldes
WRITE: |{ lv_dfies-scrtext_l WIDTH = lv_dfies-scrlen3 }|.
ENDIF.
ENDLOOP.
ULINE.
* Daten zellenweise auslesen
LOOP AT it_sflight ASSIGNING FIELD-SYMBOL(<row>).
LOOP AT it_com ASSIGNING FIELD-SYMBOL(<col>).
* Prüfen, ob DDIC-Typ, damit die Metadaten ausgelesen werden können
DATA(o_edesc2) = CAST cl_abap_elemdescr( <col>-type ).
IF o_edesc2->is_ddic_type( ) EQ abap_true.
* wenn DDIC-Typ, dann Metainformationen auslesen
DATA(lv_dfies2) = o_edesc2->get_ddic_field( ).
* anhand des Komponentennamens den akt. Zellinhalt einer Zeile lesen
ASSIGN COMPONENT <col>-name OF STRUCTURE <row> TO FIELD-SYMBOL(<cell>).
WRITE: |{ <cell> WIDTH = lv_dfies2-scrlen3 }|.
ENDIF.
ENDLOOP.
WRITE: /.
ENDLOOP.