‎2007 Jun 21 8:57 AM
Hi all,
I am creating a dynamic internal table using methods.
I have used a method
<b>ref_table_des ?=
cl_abap_typedescr=>describe_by_name( p_table ).
idetails[] = ref_table_des->components[].</b>
where p_table is name of my parameter to capture the table name.
the problem i am facing is that this method creates a structure similar to my table, but it doubles the length of each field in the new structure created.
what can be the possible reasons/bugs?
Kindly help.
Points will be rewarded for useful answers.
Regards,
Ravish Garg
‎2007 Jun 21 9:21 AM
Hi,
I dont think their's any problem in it but try if this works.
ref_table_des ?=
cl_abap_typedescr=>describe_by_name( p_table[] ).
idetails[] = ref_table_des->components[].
Regards,
Ameet
‎2007 Jun 21 9:07 AM
check the following.. by this way you can create dynamic internal table..
for dynamic tables .................
DATA: l_d_tab_ref TYPE REF TO data,
l_d_str_ref TYPE REF TO data.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
I_STYLE_TABLE = ' TABLE_NAME' " table name
IMPORTING
ep_table = l_d_tab_ref.
ASSIGN l_d_tab_ref->* TO <fs_alv_tab> .
CREATE DATA l_d_str_ref LIKE LINE OF <fs_alv_tab>.
ASSIGN l_d_str_ref->* TO <fs_alv_str> .
reward if usefull...
‎2007 Jun 21 9:16 AM
hi i have done this already. the table is being created. The problem is in the field lengths.
‎2007 Jun 21 9:21 AM
Hi,
I dont think their's any problem in it but try if this works.
ref_table_des ?=
cl_abap_typedescr=>describe_by_name( p_table[] ).
idetails[] = ref_table_des->components[].
Regards,
Ameet