‎2013 Aug 01 8:55 AM
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!
‎2013 Aug 01 12:16 PM
Kiran,
Make use of SUBMIT Zxyz AND RETURN.
WAIT N will wait for N seconds and repeat the process.
‎2013 Aug 01 12:33 PM
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