‎2006 Aug 17 5:19 AM
Hello.
>
> Does somebody know how can I get the names of the columns of an internal table at run time ? ?
>
> I mean:
>
> For example, if I create an internal table called ITAB1
>
> DATA: ITAB1 LIKE BKPF OCCURS 0,
>
> BEGIN OF ITAB2 OCCURS 0,
> FIELDNAME(40) TYPE C,
> END OF ITAB2.
>
>
> So, I want to full fill the internal table ITAB2
with all the names of the columns of the internal table ITAB1.
>
> But, I don't know how !! !
>
‎2006 Aug 17 5:21 AM
The function module GET_COMPONENT_LIST will give all the details of the columns of the table.
Regards,
Ravi
Note : Please mark all the helpful answers
‎2006 Aug 17 5:21 AM
The function module GET_COMPONENT_LIST will give all the details of the columns of the table.
Regards,
Ravi
Note : Please mark all the helpful answers
‎2006 Aug 17 5:23 AM
data : ref_descr type ref to cl_abap_structdescr.
ref_descr ?= cl_abap_typedescr=>describe_by_DATA( your_structure ).
data : it_details type abap_compdescr_tab,
wa_details type abap_compdescr.
it_details[] = ref_descr->components[].
loop at it_details into wa_details.
WRITE:/ WA_DETAILS-NAME.
ENDLOOP.
‎2006 Aug 17 6:26 AM
HEllo Selva,
U can use the FM GET_COMPONENT_LIST for this purpose.
If useful reward.
Vasanth