Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Dynamic Columns

Former Member
0 Likes
584

Hi all,

i have an internal table ITAB. It may contain multiple records.

like



MC Code      Level
A111            40
A111            35
A111            22
A111            10

etc...

the above table may contain more than 4 or any number of levels for that MC code(A111).

Now i need another internal table whose structure is


MC Code      Level1  lev2   lev3  lev4 ...... lev.N
A111               10      22     35    40          xx      

Here in the second internal table the fields are dynamic according to the first one.

(is it done trhough field symbols or etc)

Any one please tell me how to do this.

sekhar

4 REPLIES 4
Read only

former_member188770
Active Participant
0 Likes
567

Hello,

Your requirement can be easily met with the concept of dynamic internal tables.

There is lot of sample code available for dynamic internal on SDN .

Thanks,

Poonam.

Read only

0 Likes
567

HI can you please send me the links for dynamic internal tables

sekhar

Read only

0 Likes
567

Based on your requirement you need to build the fieldcatalog. and then create the dynamic table using the class cl_alv_table_create.

CALL METHOD cl_alv_table_create=>create_dynamic_table

EXPORTING

it_fieldcatalog = lt_fieldcat

IMPORTING

ep_table = dref.

ASSIGN dref->* TO <ft_tab>.

now you need to populate the data using control break .

at end of the code. you append the data.

Read only

former_member188770
Active Participant
0 Likes
567