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

Recursive background job

Former Member
0 Likes
855

Hi Experts,

Is there any way to set a background job to be executed recursively? That means once the job is finished, regardless of possible dump, it will start again. Thanks in advance!

3 REPLIES 3
Read only

Former Member
0 Likes
629

You can use the function module K_BATCH_REQUEST. or

SUBMIT the Progam via JOB NAME and JOB Number.

I mean to say that submit the same program in background within itself.

Just put a sy-subrc check before the submit.

I think it will serve your purpose.

Check if its helpful.

Read only

Former Member
0 Likes
629

hi abhisek nag,

Thanks a lot for your suggestion. For FM K_BATCH_REQUEST I cannot find in my system. For the anthor solution, I don't think it can meet my requirement because when there is an uncatchable dump in the front part of the report, the next round would never happen again. My idea is to create a background job at the very beginning which would be triggered on condition that the current job is finished, regardless of failure or success. However, since what i'm doing is very critical and any risk is unwanted. This solution is just a work-round, i'd like to know if there is any solution within the framework of background job itself?

Read only

Former Member
0 Likes
629

Hi Roger,

Programmatically you can achieve this by creating a zprogram1 & submiting your Z program inside the new ZPROGRAM1.

Use FM, JOB_OPEN, JOB_SUBMIT, JOB_CLOSE.

Use FM "BP_JOB_STATUS_GET" to get the status. If the status is successfully again call the close the job & again call the JOB_OPEN FM. THis would be inside a do...enddo loop.

Best regards,

Prashant