В общем оставил чтобы не вспоминать ещё раз.
TYPES:
BEGIN OF tt_data,
GUID TYPE ZGUID.
INCLUDE TYPE ZBWXXXXX.
TYPES:
END OF tt_data.
TYPES:
BEGIN OF tt_result.
INCLUDE TYPE ZBWXXXXX.
TYPES:
GUID TYPE ZGUID,
END OF tt_result.
data: it_ekpo TYPE STANDARD TABLE OF EKKO INITIAL SIZE 0
lt_tab TYPE TABLE OF abap_compname WITH EMPTY KEY,
lt_tab = VALUE #( ( 'MANDT' )
( 'FIELD1' )
( 'FIELD2' )
( 'FIELD3' )
( 'FIELD4' )
( 'FIELD5' ) ).
SELECT (lt_tab)
FROM MKPF.
TYPES:
BEGIN OF ty_tab,
field1 TYPE MKPF-field1,
field2 TYPE MKPF-field2,
field3 TYPE MKPF-field3,
field4 TYPE MKPF-field4,
field5 TYPE MKPF-field5,
END OF ty_tab.
lt_tab TYPE SORTED TABLE OF ty_tab,
lo_descr TYPE REF TO cl_abap_structdescr,
lt_details TYPE abap_compdescr_tab WITH HEADER LINE,
"Get the field list of the structure TY_TAB.
lo_descr ?= cl_abap_typedescr=>describe_by_name('TY_TAB').
lt_details[] = lo_descr->components[].
SELECT (lt_details-name)
FROM MKPF.
Комментариев нет:
Отправить комментарий