‎2013 Jul 22 2:51 PM
Hi All,
I have a an internal table with 1 column and 66 rows say A,B.C....
Now I need to convert this into a structure having 66 columns.
How can I achieve this ?
Please help,
Faiz
‎2013 Jul 22 2:58 PM
Hi,
You can do as following
loop at lt_table into ls_area.
wa_fc-fieldname = ls_area-column1.
wa_fc-datatype = 'STRG'.
append wa_fc to it_fc.
clear wa_fc.
endloop.
* Create dynamic internal table and assign to FS
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_fc
i_length_in_byte = 'X'
IMPORTING
ep_table = dy_table.
ASSIGN dy_table->* TO <dyn_table>.
Now that creates an internal table, if you want work area you could do that following
* Create dynamic work area and assign to FS
CREATE DATA dy_line LIKE LINE OF <dyn_table>.
ASSIGN dy_line->* TO <dyn_wa>.
Regards,
Kartik
‎2013 Jul 22 3:17 PM
‎2013 Jul 22 3:41 PM
Hi,
If you observe the parameters of mentioned method, it is clear that
It_fc should be of type LVC_T_FCAT,
wa_fc should be of type LVC_S_FCAT
Regards,
Kartik
‎2013 Jul 23 8:08 AM
Hi,
FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE.
DATA: dy_table TYPE REF TO data,
* Create dynamic internal table structure
CREATE DATA dy_table TYPE TABLE OF (p_table).
ASSIGN dy_table->* TO <dyn_table>.
* p_table required Table name
Regards,
satish sudani