Code: Alles auswählen.
FORM create_htab_itab.
"gv_structure_name
DATA lv_query_table TYPE dd02l-tabname.
DATA BEGIN OF table_structure OCCURS 10.
INCLUDE STRUCTURE dfies.
DATA END OF table_structure.
DATA table_type TYPE dd02v-tabclass.
lv_query_table = gv_structure_name.
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
tabname = lv_query_table
* FIELDNAME = ' '
* LANGU = SY-LANGU
* LFIELDNAME = ' '
* ALL_TYPES = ' '
* GROUP_NAMES = ' '
IMPORTING
* X030L_WA =
ddobjtype = table_type
* DFIES_WA =
* LINES_DESCR =
TABLES
dfies_tab = table_structure
* FIXED_VALUES =
EXCEPTIONS
not_found = 1
internal_error = 2
OTHERS = 3.
DATA lv_res TYPE STRING.
FIELD-SYMBOLS <f> TYPE ANY.
DATA i TYPE i.
i = LINES( table_structure ).
LOOP AT <data> INTO <dyn_rec>.
CLEAR lv_res.
DO i TIMES.
ASSIGN COMPONENT sy-INDEX OF STRUCTURE <dyn_rec> TO <f>.
CONCATENATE lv_res <f> INTO lv_res SEPARATED BY ht.
ENDDO.
SHIFT lv_res BY 1 PLACES LEFT.
gs_clip_data-wa = lv_res.
APPEND gs_clip_data TO gt_clip_data.
ENDLOOP.
ENDFORM.