‎2013 Jul 18 4:34 AM
Hi ABAP Experts,
I have a program that uses method: CREATE_DYNAMIC_TABLE, but it is giving run time error when the dynamic table creation exceeds 36 times. I need to create dynamic internal table about 5000 times (For different customer) so as to create 5000 different files (Customer Specific). Since my program is short dumping with Exception condition "GENERATE_SUBPOOL_DIR_FULL" raised, I think I need to have a different approach due to the limitation with this method. I am not sure how to proceed further. I did search through SDN but not getting the right help. I am new to this dynamic programing and appreciate your help.
My Current Program:
data: it_tab type ref to data.
data: it_line type ref to data.
field-symbols: <lt_cnpr> type standard table,
<ls_cnpr> type any.
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = tab_fieldcat
importing
ep_table = it_tab.
assign it_tab->* to <lt_cnpr>.
create data it_line like line of <lt_cnpr>.
assign it_line->* to <ls_cnpr>.
I have the FIELD CATALOG that needs to be converted into an internal table within a loop for about 5000 times. Can you please suggest me with a suitable solution? Appreciate if you could provide me with some sample code for quick help.
Thanks
Kannan
.
‎2013 Jul 18 5:24 AM
Hello Kannan,
The subroutine pool has a generation limit of 36 which is also applied when you call
cl_alv_table_create=> create_dynamic_table. You have to use RTTS. For a good understanding of the RTTS concept, you can refer the below links.
http://scn.sap.com/thread/1725739
http://zevolving.com/2008/09/dynamic-internal-table-creation/
Regards,
Philip.
‎2013 Jul 18 4:04 PM
Hi Philip,
Thanks for your reply.
I did go through the 2nd link, which is good but not much helpful to my situation. 1st link is not working.
Steps to Create Dynamic ITAB
To create a dynamic internal table, we need to:
I think I have the challenge to gather all the Components from the Field Catalog. I have the field Catalog already build dynamically. From this field catalog i need to build the dynamic internal table. I have all the fields and its attributes in the field catalog.
I would need some help on how to translate the field catalog into a dynamic type. Can you please provide me with some sample code? Appreciate your help.
Thanks,
Kannan.
‎2013 Jul 18 4:15 PM
HI,
Is the structure of all 5000 internal tables same ? If yes, then why dont you try to use the same internal table instead of creating it so many times.
Regards,
Kartik
‎2013 Jul 18 4:42 PM
Hi Kartik,
It may be 5000 or 50,000, in fact i never know how many different table in an execution that is determined by the selection criteria and sap data. The structure is likely to be different for every other table. Do you have any idea how to create a dynamic internal table from the field catalog I already have created.
Thanks,
Kannan
‎2013 Jul 19 5:16 AM
‎2013 Jul 19 7:05 AM
Hi Kannan,
Obviously you have a memory overflow problem here. Though I had created dynamic tables before, never have I come across a situation wherein I have to build tables more than 36 times in a loop. To get around this problem can you please try to deallocate the memory space used up for your dynamic table using the FREE statement i.e. just before your ENDLOOP statement, use the FREE it_tab statement to remove the created table from memory so that the next LOOP pass would start with a new table in memory.
Thanks & Regards,
Sarath.
‎2013 Jul 23 8:21 AM
Hi,
FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE.
DATA: dy_table TYPE REF TO data,
Unassaign <dyn_table>.
* 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
Use Above code for creating internal table
Regards,
satish sudani