07-12-2007 8:16 PM
Hello,
Im using statement GENERATE SUBROUTINE POOL to dynamically select from a table. I have to have this statement in a loop. When the number of loops is large, the program dumps with message "Unable to generate more temporary subroutine pools." . In the documentation it states this is limited to 36.
Is there anyway to free this subroutine pool (free the assigned memory) so as to create others.
If I catch the exception, I guess it wont dump but maybe only half the data will be processed.
Below is some of the code.
Thank you very much,
Rod
CREATE DATA mt_ttable TYPE TABLE OF (m_ttablename).
ASSIGN mt_ttable->* TO <mfs_ttable>.
......
......
GENERATE SUBROUTINE POOL tab NAME prog
MESSAGE mess SHORTDUMP-ID sid.
IF sy-subrc = 0.
PERFORM ('READ_DATA') IN PROGRAM (prog) IF FOUND
TABLES mt_trigger <mfs_ttable>
s_curr .
TAB contains the selection statement.
07-12-2007 8:29 PM
07-12-2007 8:37 PM
Hi,
I think limit of 36 sub-pool generations is per internal mode.
May be try to do like this way
export <what you want to put into memory> to memory id 'SRUT'.
submit <Sub Program> and return.
Sub Program
IMPORT <from memory> FROM MEMORY ID 'SRUT'.
GENERATE SUBROUTINE POOL <codetab> NAME gv_program.
IF SY-SUBRC EQ 0.
PERFORM <generated form> IN PROGRAM (gv_program).
ENDIF.
I think internal mode created by SUBMIT will be destroyed when returns.
OR
Put subroutine generation code in a function module and call that function module
with option STARTING NEW TASK
<u>aRs</u>
07-12-2007 9:33 PM
Thank you very much for the speedy and helpful tips.
I´ll try them out tomorrow and reward proper points then.
Cheers,
Rod