Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

GENERATE SUBROUTINE POOL

Former Member
0 Kudos

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.

3 REPLIES 3

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You may want to take a look at this thread.

Regards,

RIch Heilman

former_member194669
Active Contributor
0 Kudos

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>

Former Member
0 Kudos

Thank you very much for the speedy and helpful tips.

I´ll try them out tomorrow and reward proper points then.

Cheers,

Rod