07-08-2010 4:24 PM
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
EXPORTING
it_fieldcatalog = t_fieldcat
IMPORTING
ep_table = tabla
EXCEPTIONS
GENERATE_SUBPOOL_DIR_FULL = 1
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?
07-08-2010 6:26 PM
This method (cl_alv_table_create=>create_dynamic_table) is really old-fashioned and counter-performant and limited as it uses GENERATE SUBROUTINE POOL statement.
Instead you should now use RTTC to create data, search forum for more information (sometimes referred as RTTS or RTTI, though this last one doesn't correspond to creation; you'll have to use CREATE DATA statement).
That said, your question has been asked many times in the forum: http://www.sdn.sap.com/irj/scn/advancedsearch?query=filldynamicinternal+table.
To help you a little bit, you need to use ASSIGN and FIELD-SYMBOLS statements (ASSIGN COMPONENT field_name OF STRUCTURE <fs_line> TO <fs_field>)
07-08-2010 6:26 PM
This method (cl_alv_table_create=>create_dynamic_table) is really old-fashioned and counter-performant and limited as it uses GENERATE SUBROUTINE POOL statement.
Instead you should now use RTTC to create data, search forum for more information (sometimes referred as RTTS or RTTI, though this last one doesn't correspond to creation; you'll have to use CREATE DATA statement).
That said, your question has been asked many times in the forum: http://www.sdn.sap.com/irj/scn/advancedsearch?query=filldynamicinternal+table.
To help you a little bit, you need to use ASSIGN and FIELD-SYMBOLS statements (ASSIGN COMPONENT field_name OF STRUCTURE <fs_line> TO <fs_field>)
07-08-2010 7:21 PM