04-28-2009 10:45 AM
There are two jobs: Job A and Job B. Job B always has to execute after Job A. Job A is a daily Job.
I tried to schedule Job B after Job A through transaction SM36. But, daily I manually have to schedule Job B. How can I execute Job B daily automatically after completion of Job A?
Please guide me.
Thanks,
Jiten
04-28-2009 10:54 AM
schedule the job as per date/time in sm36
schedule in different time.
cheers
s.janagar
04-28-2009 10:59 AM
Thanks for your response.
But the problem is that the Job A sometimes take 1 hour to finish and sometimes 10 hours to finish, depending on the amount of data.
Also, Job B has to begin only when Job A has finished.
Please guide me accordingly.
Thanks,
Jiten
04-28-2009 10:56 AM
For scheduling the jobs automatically
Make use of the following function modules.
JOB_OPEN,JOB_SUBMIT,JOB_CLOSE.
Using this First schedule JOB A and then after waiting for certain period scedule for JOB B.
Regards
Jyo
04-28-2009 10:59 AM
Can you include the steps of job B in job A?
If not, you can add a step to job A to raise an event that job B would be waiting for periodically.
Thomas
04-28-2009 11:03 AM
Thanks Thomas for your response.
But the problem with this is that Job A is a data processing Job and Job B is a status reporting Job.
So, it would be good if I can trigger the status job on completion/cancellation of Job A.
Thanks,
Jiten
04-28-2009 11:10 AM
>So, it would be good if I can trigger the status job on completion/cancellation of Job A.
You can, by adding a step to job A that calls external program "sapevt" and an event name as parameter, or a standard or custom ABAP program that can trigger a batch event.
You then schedule job B to start after that event.
The new event can be maintained via tx SM62.
Thomas
04-28-2009 11:16 AM
Hi Thomas,
Can you please help me understand more about events?
Thanks,
Jiten
04-28-2009 11:51 AM
have a look at the sub chapters of:
http://help.sap.com/saphelp_sm32/helpdata/en/fa/096e2a543b11d1898e0000e8322d00/frameset.htm
By the way, this works only if Job A ended successfully, if it is cancelled abnormally, then subsequent steps are not executed.
Thomas
04-28-2009 11:02 AM
Hi,
For job schedule after first job.
Before releasing job B, select the job B and click on release-> a pop up box is generated with the tabs> Select after job tab and give the job A name and click on save, then release the job.
Hope this helps you.
Regards,
Rajani
04-28-2009 11:08 AM
hi,
Isn't the Start condition button helpful in this issue. Because i think if you create two jobs and assign one Job after another finishes by using the Start connd. button then your issue is solved.
ags.
04-28-2009 11:09 AM
hi,
give u r job name for job B . select start condition u will get pop up window select tab after job there u mentioned after job A name . and for B job mention date time and save it .
hope it will work
06-14-2009 2:51 PM
08-24-2009 9:30 AM
Hi Jiten,
I am facing the same issue?
If you have solved your issue can you please explain what steps you have followed?
Thanks in Adnance
Snehal
08-24-2009 9:44 AM
Hello Snehal,
While releasing JOB in SM37 you can use "AFTER JOB" and mention JOB NAME in text box after which you want to execute the second JOB.
Hope this helps!
Thanks,
Augustin.
08-24-2009 11:27 AM
Hi Snehal,
In our SAP landscape we are using a Job scheduling tool. So we are using this tool to trigger Job B after completion or cancellation of Job A.
If you are not using such tool then you opt to schedule the second Job according to the completion time required for first Job.
If say you schedule first Job at 09:00 hrs and it takes on an average, say at the max, 4 hours then you can schedule the second job at 1300 hours or even after that.
Or you can try to make the second job as the step of 1st Job.
It depends on your requirement.
Thanks,
Jiten