Skip to Content
1

How to convert an internal table into dynamic internal table.

Jan 31, 2017 at 07:44 AM

57

avatar image

Hello,

I've created an internal table in following way :

go_struc ?= cl_abap_structdescr=>describe_by_data( <all_struc1> ).
gt_comp1 = go_struc->get_components( ).
CLEAR go_struc.
* * * Get the fields of the 2nd structure
go_struc ?= cl_abap_structdescr=>describe_by_data( <gs_struc2> ).
gt_comp2 = go_struc->get_components( ).
CLEAR go_struc.
* * Merge the fields of the 2 structures
APPEND LINES OF gt_comp2 TO gt_comp1.

<all_struc1> - This structure has few fields

<gs_struc2> - This structure has few fields

So i have one final table GT_COMP1 with all the fields from both structure. Now i want to create a dynamic table out of this internal table. Please do remember that both <Struc1> and <Struc2> can have N number of fields . So GT_COMP1 will have N number of fields during run time.

So how to create dynamic internal table from GT_COMP1 .

Thanks,

Vimal

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Horst Keller
Jan 31, 2017 at 09:14 AM
1
Share
10 |10000 characters needed characters left characters exceeded