Skip to Content
0
Former Member
Nov 08, 2006 at 02:59 PM

ref_descr ?= cl_abap_typedescr=>describe_by_name explanation

1925 Views

Hello Everyone,

Can somebody explain what is happening

in this part of the code. Below the complete code.

-


ref_descr ?= cl_abap_typedescr=>describe_by_name( p_table ).

it_details[] = ref_descr->components[].

-


One more request, what are these structures

abap_compdescr_tab, abap_compdescr, cl_abap_structdescr, lvc_s_fcat are these tables? Please kindly let me know

-


data : it_details type abap_compdescr_tab,

wa_details type abap_compdescr.

data : ref_descr type ref to cl_abap_structdescr.

data: new_table type ref to data,

new_line type ref to data,

wa_it_fldcat type lvc_s_fcat.

ref_descr ?= cl_abap_typedescr=>describe_by_name( p_table ).

it_details[] = ref_descr->components[].

loop at it_details into wa_details.

clear wa_it_fldcat.

if wa_details-name = 'TIMESTMP'.

wa_it_fldcat-fieldname = wa_details-name.

wa_it_fldcat-datatype = wa_details-type_kind.

wa_it_fldcat-inttype = wa_details-type_kind.

wa_it_fldcat-intlen = r.

wa_it_fldcat-decimals = wa_details-decimals.

append wa_it_fldcat to it_fldcat.

append wa_it_fldcat-fieldname to it1.

else.

wa_it_fldcat-fieldname = wa_details-name.

wa_it_fldcat-datatype = wa_details-type_kind.

wa_it_fldcat-inttype = wa_details-type_kind.

wa_it_fldcat-intlen = wa_details-length.

wa_it_fldcat-decimals = wa_details-decimals.

append wa_it_fldcat to it_fldcat.

append wa_it_fldcat-fieldname to it1.

endif.

endloop.

Thanks

Krishna