on 03-30-2016 7:41 AM
Hi,
I have a requirement of executing a standard report program in background forever. Meaning as soon as the first execution of background job is over, another execution of same program should start and this should go on and on. I could not find any option to achieve this using SM36.
Is there any way of achieving this?
You use SAP events to do this.
Further read: Scheduling background job by triggering an event - ABAP Development - SCN Wiki for more information.
How to do this:
Create a custom event in SM62.
Create a background job in SM36, with 1st step as the required program and 2nd step as BTC_EVENT_RAISE.
Release the background job, as a periodic job, with a start condition dependent on event created in SM62.
Run BTC_EVENT_RAISE once manually, giving the event name.
The manual execution will trigger the event, which will activate the job. When the 2nd step of the job runs, it will trigger the event again, causing the job to be activated again.... and so on.
Thanks, Juwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Isn't that exactly what you wanted ? You said:
"as the first execution of background job is over, another execution of same program should start and this should go on and on"
Well that is what is happening now.
You can stop it by selecting the active job and choose abort/stop active job from the menu
Hi Sagar,
I think Patrick suggestion to delete the event is the best solution.
You better change your job by having the 2nd step as a custom program. In there you can add a statement wait for 20 seconds (or whatever time you choose) before raising the event.
You then will have the option to stop the active job.
Also just to add : if you dont want any custom logic to be built, you can check with your Basis team if they can write some sort of unix scripting [shell script] to achieve this and in that case they control the scheduling and we dont need to use SM36 again..
if not thirt party schedulers are aso available..just an option though..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
One option that comes to mind is to schedule a jo with your program AND a custom program.
The custom program should just raise an event and then you can schedule the job after event (the event you are raising in step 2 of the job).
Then create two jobs, one with both programs (step 1 and step 2)scheduled by date time and one with the same programs scheduled after event.
Once the first scheduled job (date time ) starts the 2nd step will raise the event which will start the job scheduled after event. This 2nd job will start now every time again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.