How to prevent jobs from running multiple times in parallel
When having periodical jobs with big differences in runtime and you want to prevent the jobs to run multiple times in parallel, SAP has a report called RSBTONEJOB2.
You just have to create a variant for this report:
REPORT is the report you want to run as job step, VARIANT the variant you have to create beforehand.
Now you have to save this variant with the same name as the variant of the report:
Now create the job in SM36:
The job name has to be the JOBNAME you entered before. As step, you just have to add RSBTONEJOB2 with the created variant:
When this job runs, it first checks if there is another job with the same name – if not, the entered REPORT is executed with the selected VARIANT.
Hi Daniel,
This looks like a very useful function; We can all think of jobs that are scheduled, say, hourly, usually run for 5 minutes, but occasionally run well over.
A couple of questions;
- Do you know what release this was first available in ?
- What sort of error or warning does the RSBTONEJOB2 step give if it prevents REPORT from starting ?
- Just to clarify - In the job definition, is the step that runs RSBTONEJOB2 before or after the step that runs REPORT ?
thanks
22.07.2015 00:00:09 Job started
This is the output when the report has checked that there's only one Job running. AFAIK, the report doesn't make the job run red, it just says that there's already an instance of this job running. In job definition, you only put in RSBTONEJOB2 with the variant, the report runs the desired report:
The report is pretty old, I remember using it since 5 or 6 years (NW 7.0).
Daniel, thanks for sharing.
If you search Google for RSBTONEJOB2 there are many SCN posts available. Also if you search for 'prevent jobs running in parallel site:sap.com' the second post from the top mentions this program.
With this in mind, I feel it should take more than just adding the screenshots to make it a good SCN document. Right now the comments are longer than the document itself. 🙂
Martin already posted some good follow-up questions. At minimum I'd also suggest to add the examples of the successful and duplicate job run in the document (instead of a comment). If there are some limitations in using this report or some practical tips, why not share those too? It'd make a much better content.
Thank you.
You're right, the document is missing the USP... 😉 I will work on it.
Had to google USP and I liked it. 🙂
😀