Application Development and Automation 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: 
Read only

Call same tcode without falling into endless loops

Former Member
0 Likes
746

Hello Experts,

When Changing Report A it is nesecceary to use


SUBMIT Report B

                 WITH s_batch IN rt_charg

         EXPORTING LIST TO MEMORY  AND RETURN.

But in our case Report B is a Replica of Report A and we would not want to keep two identical programs to prevent the accumulation amount of information that we do not need making it difficult to categorize.


Is it possible to Submit the Same Report A but avoiding the endless loop. eg the first time it will submit Report A. When inside Report A there should be a condition that will prevent Sumbmision again Report A and continue the rest of the code.


Searching the web I have come across with inner session. I was thinking something like:

If inner session = 1 then:


SUBMIT Report A

                 WITH s_batch IN rt_charg

         EXPORTING LIST TO MEMORY  AND RETURN.

else.

exit.

Thanks in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
695

Set a memory ID in the first report,  read it in the second and if it's set then don't call it,  or even better use the same enqueue function that SE38 uses to lock a program for change.  Then in the second report try to lock the same record and if it fails don't do the submit.

With the memory ID you need to remember to clear it when you have finished.

Rich

3 REPLIES 3
Read only

Former Member
0 Likes
696

Set a memory ID in the first report,  read it in the second and if it's set then don't call it,  or even better use the same enqueue function that SE38 uses to lock a program for change.  Then in the second report try to lock the same record and if it fails don't do the submit.

With the memory ID you need to remember to clear it when you have finished.

Rich

Read only

0 Likes
695

Is it possible to provide some sample code because I am new to this. Thanks in advance!!

Read only

0 Likes
695

Look either at following statements documentation

  • SET / GET PARAMETER ID
  • EXPORT TO / IMPORT FROM MEMORY

(And don't forget to clear memory after execution)

Regards,
Raymond