‎2008 Jul 10 3:22 PM
Hello friends,
I am working on 2 systems in 4.7 and 4.6.
I have to create a dynamic internal table based on the table name passed on the selection screen.
I am able to do this in 4.7 with the below statement.
DATA: i_table_update TYPE REF TO data.
PARAMETERS: p_table TYPE tabname OBLIGATORY.
CREATE DATA i_table_update TYPE STANDARD TABLE OF (p_table).
the above statement has a syntax error in 4.6
the error is
Unable to interpret "TABLE". Possible causes of error: Incorrect spelling or comma error.
Any suggestions.
‎2008 Jul 10 3:27 PM
‎2008 Jul 10 3:27 PM
‎2008 Jul 10 3:29 PM
Thanks Rich,
Whats the alternative for this.
The problem we are doing some database changes for the material group and we have to this for many tables based on the table name passed on the selection screen.
Thanks and pls let me know if you have any example of this.
Ster.
‎2008 Jul 10 3:34 PM
Try this way
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = p_table " Table Name
changing
ct_fieldcat = i_fcat
exceptions
others = 1.
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = i_fcat
importing
ep_table = i_content.
if sy-subrc = 0.
assign i_content->* to <ptab>.
else.
write: 'Error creating internal table'.
endif.
a®
‎2008 Jul 10 3:32 PM
Hi,
Refer to this program:
http://www.sap-img.com/ab030.htm
Write a small subroutine, to create a dynamic table.
Regards,
Subramanian
‎2008 Jul 10 3:38 PM
‎2008 Jul 10 3:50 PM
Thanks ALL,
ARS I will trying ur approach and would get back if I have any questions.
Thanks,
Ster.
‎2008 Jul 10 4:12 PM