cancel
Showing results for 
Search instead for 
Did you mean: 

Scheduling jobs with complex dependencies through SAP CPS

Former Member
0 Kudos

Hi All,

We've a requirement as follows,

There are two jobs

Job A : Runs at 5 PM

Job B: Runs at 8 PM

Dependency:

If Job A completes before 8 PM, then Job B should get triggered at 8 PM

OR

If Job A is over running even after 8 PM, then Job B should wait till Job A completes and then get triggered.

An elaborate procedural reply would be much appreciated.

Regards,

Harsha

Accepted Solutions (1)

Accepted Solutions (1)

gmblom
Active Contributor
0 Kudos

Hello,

Create a chain with two steps running jobs A and B after each other. Submit the chain at 5AM, this will trigger the first job. Now set the Start Time scheduling parameter on the second job (inside the chain) at an expression, something like =Time.expressionNow('truncate day add 8 hours') this will set the start time of the second job at 8AM.

Regards Gerben

Former Member
0 Kudos

Hi Gerben,

Now set the "Start Time scheduling parameter" on the second job (inside the chain) at an expression...

Can you please elaborate on this...

Thanks in advance!

gmblom
Active Contributor
0 Kudos

Hello,

Select the job B in the second step of the chain, on the right hand side there will be a field called StartTime.

Regards Gerben

Former Member
0 Kudos

But the request was to start at 8PM not 8AM. Can you elaborate on the function of:

=Time.expressionNow('truncate day add 8 hours')

I would have thought that simply setting the start time as 8PM on step 2, if in a chain, would mean it'll be delayed if step 1 overruns and otherwise will start at the set time?

Also the start time field on a chain step seems strangely to be a free text field? (see image)

Former Member
0 Kudos

Hi Gerben & Jamie,

I'm afraid I'm not able to find StartTime field.

CPS Version: SAP 7.00

Build: M26. 12-29604

May be the version we're using don't support this.

Is there any other ways I can automate this scenario?

Regards,

Harsha

gmblom
Active Contributor
0 Kudos

Hello Harsha,

Yes M26 will indeed not support that feature. In that case do not make a job chain, but schedule your jobs at 5PM and 8PM. To make the dependency between the two create an event that is raised by Job A and make job B wait for it. This will achieve the same goal.

Note that M26.12 is already 4 years old and not really a supported version anymore. Consider upgrading.

Regards Gerben

gmblom
Active Contributor
0 Kudos

Hello Jamie,

Yeah so make it =Time.expressionNow('truncate day add 20 hours') for 8PM.

The reason the start time field is a free text field is because it allows you to set expressions (start with =). I must say I have never tried setting 8PM as the start time, maybe that works too.

Regards Gerben

Former Member
0 Kudos

Hey Gerben,

Dont have much idea about Event Definitions. Can you please help me out...

Regards,

Harsha

gmblom
Active Contributor
0 Kudos

Hello Harsha,

Go to Definitions->Event Definitions and create a new Event Definition (give it a useful name).

Now go to Job Definition A and go to the Job Raise Events. Add your newly created Event Definition there and specify to Raise on status Completed.

Now go to Job Definition B and go to the Job Wait Events. Add the same Event Definition here and specify to Never auto submit and check the clears event box.

Now submit Job A at 5PM and submit Job B at 8PM. Job B will now wait until the event is raised when it is not yet raised at 8PM.

Regards Gerben

Former Member
0 Kudos

Thanks a lot Gerben, it was of great help!!

Former Member
0 Kudos

Hi Harsha,

Could you please help me, even we have the same dependency requirement.

We have some dependency event triggred process chians.

After successful completion of Process chain A it triggers Process chain B.

in this scenario how to schedule the chains in cps. can you please let me know.

That would be great help.

Regards,

Usha

Former Member
0 Kudos

Hi Usha,

Please follow the procedure mentioned by Gerben above. That would help you.

Do revert back for any issues!

Regards,

Harsha

Answers (0)