Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Job Scheduling

former_member325225
Participant
0 Kudos

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

15 REPLIES 15

former_member183990
Active Contributor
0 Kudos

schedule the job as per date/time in sm36

schedule in different time.

cheers

s.janagar

0 Kudos

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

jyotheswar_p2
Active Participant
0 Kudos

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

ThomasZloch
Active Contributor
0 Kudos

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

0 Kudos

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

0 Kudos

>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

0 Kudos

Hi Thomas,

Can you please help me understand more about events?

Thanks,

Jiten

0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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.

Former Member
0 Kudos

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

former_member325225
Participant
0 Kudos

.

Former Member
0 Kudos

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

0 Kudos

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.

0 Kudos

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