SAP for Utilities Discussions
Connect with fellow SAP users to share best practices, troubleshoot challenges, and collaborate on building a sustainable energy future. Join the discussion.
cancel
Showing results for 
Search instead for 
Did you mean: 

Scheduling job with dynamic start condition

Former Member
0 Kudos

Hi Experts,

I have the following jobs which are running automatically everyday.

1. Automatic clearing runs automatically everyday at 21:30. This is scheduled using job container. The name of the job getting executed(From SM37)

FKJOCRE__MA00000120130724213000 .

Here the container name is MA000001+Date(YYYYDDMM)+TIME(HHMMSS).

2. There is another job for the Activation of the installments, whihc takes place at 21:45 everyday. This is defined using SM36 and with ABAP program in the background.

I wanted to establish a dependency between these 2 jobs.

Activation of the installments should work only after the execution of Automatic clearing(defined usig jobcontainer FKJOXTR)

In SM36 from start conditions, I can define the dependency. But here my job name is dynamic as explained above with date and time. How can I define, here?

For ex:- Today dated 25.07.2013, Installment plan reactivation should happen only after the execution of the job,

FKJOCRE__MA00000120130725213000 and tomorrow the job would be with the name FKJOCRE__MA00000120130726213000.

How to acheive this?

Thanks in advance!

Lakshmi

1 ACCEPTED SOLUTION

raviahuja
Contributor
0 Kudos

Yes, as Bill suggested, you might have to use a wrapper program for second report to identify the correct name of first report and then schedule it after first report ends. Or you can use third party scheduler tools like Control-M to handle this situation out.

Regards,

Ravi

View solution in original post

4 REPLIES 4

william_eastman
Advisor
Advisor
0 Kudos

Lakshmi:

Your best bet is to create a wrapper to allow the second program to be input into the job chain.  Possibly you could create a new program which sniffs out the information and status of the first job.  Beyond that, you would likely need to use an external job scheduling tool.

regards,

bill.

raviahuja
Contributor
0 Kudos

Yes, as Bill suggested, you might have to use a wrapper program for second report to identify the correct name of first report and then schedule it after first report ends. Or you can use third party scheduler tools like Control-M to handle this situation out.

Regards,

Ravi

Former Member
0 Kudos

Hallo Ravi.

Thank you for the alternatives suggested. I would prefer wrapper program for the same.

1. How to know when will my first job from job container ends. I checked it in table TBTCO, it has startdate,starttime,enddate and endtime fields as empty. Where I can get the information, the time frame that the job has ended.

2. Can i used the field status from TBTCP table inorder to check whether my first job is successfully executed?

3. How to create a wrapper program to extract this info.

4. How to populate values as start condition for the begin of the second job.

I have googled about wrapper program and I ended up only with this link http://wiki.sdn.sap.com/wiki/display/SCM/Developing+a+Wrapper+Program

Thats helpful to get basic insight into the tpoic, but not able to go further with this.

 

Thanks in advance!

Lakshmi.

0 Kudos

Hi Lakshmi,

You can use the field STATUS of table TBTCO. If it is equal to "F", the job is finished successfully. You can check for the status in time intervals in your wrapper program.

About wrapper program, it is nothing but an ABAP report, which will be scheduled in background instead of your second report and you second report will be called in this wrapper program.

The high level logic in the wrapper program could be:

1. At regular intervals, keep on checking the status of your first job.

2. Once it is finishes, trigger your second report using submit statement.

You can trigger both your first job and the wrapper program simultaneously in background. Your first report will continue as it is and you wrapper program in background will keep checking status of first job at regular interval. As soon as it finishes, it will trigger your second program.

Regards,

Ravi