Skip to Content

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:

RSBTONEJOB2_1.jpg

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:

RSBTONEJOB2_2.jpg

Now create the job in SM36:

RSBTONEJOB2_3.jpg

The job name has to be the JOBNAME you entered before. As step, you just have to add RSBTONEJOB2 with the created variant:

RSBTONEJOB2_4.jpg

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.

To report this post you need to login first.

6 Comments

You must be Logged on to comment or reply to a post.

  1. Martin English

    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

    (0) 
    1. Daniel Lippmann Post author

      22.07.2015 00:00:09 Job started                                                                 

      00       516      S
      22.07.2015 00:00:09 Step 001 started (program RSBTONEJOB2, variant <Variant>, user ID <User>)  00       550      S
      22.07.2015 00:00:09 Prüfe Zahl der aktiven Jobs mit Namen <Jobname>           00       398      I
      22.07.2015 00:00:09 Ok, genau ein Job läuft                                                        00       398      S
      22.07.2015 00:00:18 Job finished                                                                   00       517      S

      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:

      /wp-content/uploads/2015/07/rsbtonejob2_753406.png

      The report is pretty old, I remember using it since 5 or 6 years (NW 7.0).

      (0) 
  2. Jelena Perfiljeva

    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.

    (0) 

Leave a Reply