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

Wrapper program to check status and call another program

Former Member
0 Likes
554

Hi Everyone,

I have a requirement in which I want to check the status of a job at regular intervals. Once it is finished I wanted to call another ABAP program named Zxyz through submit code.

1. I think the status of the job can be retrieved from TBTCO table from field STATUS. If it equals to 'F', which indicates that this successful execution.

DO

select single status into l_status from TBTCO where JOBNAME = myjob1.

IF sy-subrc = 0.

    if l_status == 'F'

      *Job has been successfully executed, call the second program with the help of submit

       submit Zxyz.

      *exit the loop

       exit.

else

    *if the job is not yet executed

     wait 5.

endif.

ENDDO.

I have the following questions with my coding:-)

If the status of the job is F, I want to exit the loop and call the second program(Zxyz) through submit. Will this cod eexit the loop?

If the job has n't been executed i wanted to wait for some time and chek the status. Will wait 5 serves my purpose.

Can someone correct the code for me.?

Thanks a lot in advance!

2 REPLIES 2
Read only

Arun_Prabhu_K
Active Contributor
0 Likes
464

Kiran,

     Make use of SUBMIT Zxyz AND RETURN.

     WAIT N will wait for N seconds and repeat the process.

Read only

ThomasZloch
Active Contributor
0 Likes
464

Why not just add the ABAP program to be submitted as another step in the job that you are status checking? This way it will start whenever the previous step has finished successfully.


Thomas