Skip to Content
Jul 08, 2010 at 03:24 PM

fill dinamic internal table from internal table


Hi gurus i need to know how can i fill a dinamic interna table from another internal table

example i have the table called it_info with the followin information

field1 field2 field3

Alex Ross 1

Rita Campos 1

because i have the same value in field 3 i have to agroup register 1 and 2 in the same line so the data should be in the next way

Field1 field2 field3 field4 field5

Alex Ross 1 Rita Campos

I have made a dinamic interna table so my table has the 5 fields but i dont know how to trasfer the data to my dinamic internal table, any idea? my source code:

it_campos-campo = 'Field1'. APPEND it_campos.

it_campos-campo = 'Field2'. APPEND it_campos.

it_campos-campo = 'Field3'. APPEND it_campos.

it_campos-campo = 'Field4'. APPEND it_campos

loop at it_campos .

t_fieldcat_wa-col_pos = SY-TABIX.

t_fieldcat_wa-fieldname = it_campos-campo.

APPEND t_fieldcat_wa TO t_fieldcat.

endloop .

CALL METHOD cl_alv_table_create=>create_dynamic_table


it_fieldcatalog = t_fieldcat


ep_table = tabla



others = 2.

ASSIGN tabla->* TO <l_table>.

CREATE DATA ep_line LIKE LINE OF <l_table>.

ASSIGN ep_line->* TO <l_line>.

Now my dinamic internal table <l_table> is ready but how should i trasnfer the it_info data to this other table?