Code: Alles auswählen.
Component .. Type Length .. Short Description
Art1 char 10 BeschreibungSpalte1
Art2 char 20 BeschreibungSpalte2
Art3 numc 10 BeschreibungSpalte3
Code: Alles auswählen.
Art1Wert1 Art2Wert1 Art3Wert1
Art1Wert2 Art2Wert2 Art3Wert2
Art1Wert3 Art2Wert3 Art3Wert3
Art1Wert4 Art2Wert4 Art3Wert4
Code: Alles auswählen.
BeschreibungSpalte1 BeschreibungSpalte2 BeschreibungSpalte3 .....
Art1Wert1 Art2Wert1 Art3Wert1
Art1Wert2 Art2Wert2 Art3Wert2
Art1Wert3 Art2Wert3 Art3Wert3
Art1Wert4 Art2Wert4 Art3Wert4
Code: Alles auswählen.
FORM read_detail_list_header USING struct_of_list TYPE any
separater TYPE any
CHANGING suminfo TYPE string.
DATA: descr_ref TYPE REF TO cl_abap_structdescr,
fieldname TYPE dfies-lfieldname,
tabname TYPE dfies-tabname,
infotext TYPE DD04V-SCRTEXT_L.
FIELD-SYMBOLS: <comp_wa> TYPE abap_compdescr.
descr_ref ?= cl_abap_typedescr=>describe_by_data( struct_of_list ).
tabname = descr_ref->get_relative_name( ).
LOOP AT descr_ref->components ASSIGNING <comp_wa>.
fieldname = <comp_wa>-name.
CALL FUNCTION 'DDIC_FIELDNAME_GET'
EXPORTING
iv_strucname = tabname
iv_fieldname = fieldname
CHANGING
cv_field_description = infotext
EXCEPTIONS
no_data = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CONCATENATE suminfo infotext INTO suminfo SEPARATED BY separater.
ENDLOOP.
....