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

Dear Experts,

In the following logic, i'm trying to call the subroutine with in the LOOP statement. The program is executing well for the first record of the itab, but it is fail to execute for the next subsequent records, and is getting failed to trigger the Perform statement for the second record saying that 'Program Does Not exist'. Pl. can someone can point-out the defect in the logic.

LOOP AT ITAB INTO ITAB_WA.

v_where = '&' AND '&'.

REPLACE '&' WITH ITAB_WA-X INTO v_where.

REPLACE '&' WITH ITAB_WA-Y INTO v_where.

CONDENSE v_where NO-GAPS.

tab-line = 'Report sy-repid.'.

append tab. clear tab.

tab-line = 'form f_create_apps using value(v_where).'.

append tab. clear tab.

concatenate tab-line 'do some thing' v_where INTO TAB-LINE separated by space.

append tab. clear tab.

tab-line = 'endform.'.

append tab. clear tab.

TRY.

generate subroutine pool tab name v_name.

perform f_create_apps in program (v_name) using v_where.

  • Exception Catching.

CATCH cx_root INTO o_field.

text = o_field->get_text( ).

  • Calling Function to give information message regarding Exception

CALL FUNCTION 'POPUP_TO_INFORM'

EXPORTING

titel = text-t03

txt1 = text

txt2 = text-t04.

LEAVE TO LIST-PROCESSING.

ENDTRY.

ENDLOOP.

I'm very thankful for your suggestions.

with best regards

Mahesh

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Problem might be due to the variables used ie v_name. Before the end of the loop clear v_name and try.

Thanks,

Muthu.

Message was edited by:

Muthu Prabakaran Selvam

5 REPLIES 5

Former Member
0 Kudos

Hi,

Any suggestions please. I think my question is clear.

thank you

marcelo_ramos
Active Contributor
0 Kudos

Hi,

The statement <b>GENERATE SUBROUTINE POOL</b> has a limitation, we can't run it more then 36 times.

I think you Could run only one time for all entries in your internal table, after for each line of internal table you execute the perform passing the parameter to identify it line.

I hope I have helped

Regards.

Marcelo Ramos

Former Member
0 Kudos

Hi,

Problem might be due to the variables used ie v_name. Before the end of the loop clear v_name and try.

Thanks,

Muthu.

Message was edited by:

Muthu Prabakaran Selvam

marcelo_ramos
Active Contributor
0 Kudos

Hi,

You Must refresh <b>tab</b> before run again. Otherwise you'll continue duplicating lines in internal table TAB.

<b>Don't forget to statement limitation.</b>

Regards.

Marcelo Ramos

Former Member
0 Kudos

Hi, Marcelo

Thanks for the hint. Refreshing Tab has solved part of my problem.

best regards

Mahesh