2014 Feb 24 6:16 AM
I have an internal table with only one column it_table:
it_table:
sales_org
distribution_channel
division
material
.
.
.
Now I want to transpose this table so that i can download the table in an excel with only one row:
sales_org distribution_channel division material.......
Please help me to implement this?
2014 Mar 05 3:50 PM
Hi,
You can create a dynamic table using some code like this:
TRY.
FREE lo_st_type.
lo_st_type = cl_abap_structdescr=>create( gt_cols ).
IF lo_st_type IS NOT INITIAL.
CREATE DATA lo_st_data TYPE HANDLE lo_st_type.
UNASSIGN <fs_data_wa>.
ASSIGN lo_st_data->* TO <fs_data_wa>.
CREATE DATA lo_data LIKE STANDARD TABLE OF <fs_data_wa>.
UNASSIGN <g_table>.
ASSIGN lo_data->* TO <g_table>.
ENDIF.
CATCH cx_sy_table_creation.
ENDTRY.
gt_cols is type abap_component_tab and should have as many lines as your table it_table.
After you create the dynamic table you have to fill it with the info in it_table.
Try it out and I will help you if needed.
Martin