Application Development 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: 

Background Job Scheduling Status

Former Member
0 Kudos

Hi All,

I have a requirement in which I want to schedule background jobs using SUBMIT for different Company Codes.

Consider there are 3 company codes (U001, U002 and U003). In this case there will be a main job for U001 and another job for U002 is dependant on the first job (U001) and this U002 will get executed immediately the U001 is completed successfully. If unsuccessful, next job need not to be run. Also I have to keep the main program active till all jobs finishes.

Kindly help me with getting the status of the job run which will decide the next job run.

Thanks

Natasha Garg

5 REPLIES 5

Sandeep_Kumar
Product and Topic Expert
Product and Topic Expert
0 Kudos

Check the parameters : PREDJOB_CHECKSTAT,PRED_JOBCOUNT,PRED_JOBNAME of FM : JOB_CLOSE for the same.

Based on these parameters you can schedule the jobs based on status of previous jobs.

Former Member
0 Kudos

Hi ,

You have to create Events in SM37 transaction.

thanks & Regards,

rakesh.

former_member198275
Active Contributor
0 Kudos

Have a look at the tables TBTC* ( press F4) in SE11. All these are Batch job related. Some can be helpfull for your logic.

raymond_giuseppi
Active Contributor
0 Kudos

Read this documentation [Scheduling a Job: Full-Control Method|http://help.sap.com/saphelp_nw04/helpdata/en/fa/096ce5543b11d1898e0000e8322d00/frameset.htm]. There are samples in this documentation like [Sample Program: Wait for Predecessor Job with JOB_CLOSE|http://help.sap.com/saphelp_nw04/helpdata/en/fa/096db5543b11d1898e0000e8322d00/frameset.htm]

Regards,

Raymond

Former Member
0 Kudos
SUBMIT ZXXXX AND RETURN. "main job for U001
IF SY-SUBRC = 0.    "means job is success. 
    SUBMIT ZXXXX AND RETURN. " job for U002
ENDIF.

NOTE:

We can not keep the success fully finished job as active for the next job to get succed.

To do Same, we can create a job using JOB_OPEN and make the same run in different steps. So the second step (U002) runs if the first step (U001) is success. It suits for your requirement.

Edited by: Thomas Zloch on Dec 20, 2010 10:33 AM - please use code tags for code only