Skip to Content

Hi,

Please go through below to know how to keep only one instance of batch job active.

Requirement :

Keep only one instance of active job is running for a single Job

Solution:

SAP  provided a standard program to handle this scenario. The program name is RSBTONEJOB2.


Please find the below steps :-


1. Create a variant for the program which you want to schedule the batch job.


2. Create a variant for  RSBTONEJOB2 with job name , report name and variant. I create the variant ‘DEMO_VARIANT’.

   

   

   

3. Go to SM36, create a job with same name give in variant of RSBTONEJOB2 .

    

4. Click on step, enter abap program name RSBTONEJOB2 and variant DEMO_VARIANT. Start the job immediately and save.

   

5. Go to SM37 and you can see the job ZDEMO_KEEP_ONE_ACTIVE_INSTANCE will be in active status.

6. Copy the job and release it. The second job will be finished with below job log.

   

7. The log of first job

   

This scenario is been asked number of times in SCN. Hope this helps to fellow SCN member.

Therefore I request all SAP folks to share there comments and add something i missed here.

Thanks

-Always Learner

To report this post you need to login first.

1 Comment

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

  1. Jozef Vaclavek

    Hi,

    this scenario only displays, that there could be more instances running, but is there any way how to stop the second step of the job from running once there already is one? I would like to schedule a job for importing of idocs hourly, but there are situations, when one hour is not enough to process all the idocs.

    So once the previous run of idocs import is not finished, I would not like to start another one. How to achieve this?

    (0) 

Leave a Reply