10-16-2007 12:13 PM
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
10-16-2007 1:07 PM
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
10-16-2007 12:40 PM
Hi,
Any suggestions please. I think my question is clear.
thank you
10-16-2007 1:02 PM
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
10-16-2007 1:07 PM
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
10-16-2007 1:42 PM
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
10-16-2007 2:48 PM
Hi, Marcelo
Thanks for the hint. Refreshing Tab has solved part of my problem.
best regards
Mahesh