‎2010 Jun 28 8:29 AM
Dear All,
I have a table TOTO of 1 column and n lines.
From TOTO, i want to create a table TITI with following requirement:
Number Columns = n lines
How can i proceed ?
Rodolphe.
‎2010 Jun 28 9:40 AM
Hi Rodolphe,
Create the Dynamic Internal table using the Following method.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
i_style_table = gc_yes
it_fieldcatalog = it_fieldcatalog
IMPORTING
ep_table = lr_table
e_style_fname = mv_style_fname."name for style table
Regards,
Deepak.
‎2010 Jun 28 8:33 AM
‎2010 Jun 28 9:36 AM
‎2010 Jun 28 10:05 AM
They are not getting deleted automatically!
They are being deleted by the moderators because you are violating the rules of this forum. This is the right time for you to read the rules to avoid getting your id deleted.
pk
‎2010 Jun 28 9:40 AM
Hi Rodolphe,
Create the Dynamic Internal table using the Following method.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
i_style_table = gc_yes
it_fieldcatalog = it_fieldcatalog
IMPORTING
ep_table = lr_table
e_style_fname = mv_style_fname."name for style table
Regards,
Deepak.
‎2010 Jun 28 9:48 AM
‎2010 Jun 28 10:50 AM
Hi Rodolphe,
using cl_alv_table_create=>create_dynamic_table may raise exception generate_subpool_dir_full after 36 times (memory issue)
try the following code:
TYPES: BEGIN OF ty_toto,
col TYPE i,
END OF ty_toto.
DATA it_toto TYPE TABLE OF ty_toto.
DATA wa_toto TYPE ty_toto.
DATA v_lines TYPE i.
DATA dref TYPE REF TO data.
DATA struct_type TYPE REF TO cl_abap_structdescr.
DATA comp_tab TYPE cl_abap_structdescr=>component_table.
DATA comp LIKE LINE OF comp_tab.
DATA v_col_name TYPE string.
FIELD-SYMBOLS: <titi> TYPE ANY.
* Create table content
DO 10 TIMES.
wa_toto-col = sy-index.
APPEND wa_toto TO it_toto.
ENDDO.
DESCRIBE TABLE it_toto LINES v_lines.
* Define structure
DO v_lines TIMES.
v_col_name = sy-index.
CONCATENATE 'COL_LINE_' v_col_name INTO v_col_name.
CONDENSE v_col_name NO-GAPS.
comp-name = v_col_name.
comp-type = cl_abap_elemdescr=>get_i( ).
APPEND comp TO comp_tab.
ENDDO.
* Create Table
struct_type = cl_abap_structdescr=>create( comp_tab ).
CREATE DATA dref TYPE HANDLE struct_type.
* Assign table
ASSIGN dref->* TO <titi>.regards
rea