05-25-2011 12:20 PM
Hello,
I am trying to schedule a job that runs every night at 2.00am, but for a certain period every month - say from 4th April to 25th April, excluding weekends.
I have been told that I need to write an ABAp program for this, as the end date for a job cannot be defined in job scheduling.
The requirement is to run the job for a fixed number of days every month.
How do I achieve this?
Thanks for your help!
vaishali
Moderator message: please choose more descriptive subject lines for your posts.
Edited by: Thomas Zloch on May 25, 2011 1:52 PM
05-25-2011 1:36 PM
SAP's own periodic job scheduling capabilities are limited.
Some potential workarounds for your scenario, more or less nasty, expensive or complex:
- create specific holiday and factory calendars and use these in your jobs for skipping to next "workday"
- schedule multiple monthly jobs on the desired days
- write bespoke scheduling program (as suggested above and below)
- deploy more sophisticated, 3rd party job scheduling tools
Thomas
05-25-2011 12:33 PM
Hi,
Write a program in which use a FM to run the job which you have to run. Schedule this ABAP program to run at 2:00AM everyday. Inside the program check the system date and accordingly decide whether your job has to be run or not.
The FM J_1O1_JOB_START is used to start a job. Similarly you can search more FMs in SE37 by putting *job* in the description field.
Hope this helps.
05-25-2011 12:36 PM
05-25-2011 1:23 PM
Hello,
I cannot find the Finish date anywhere in the variant maintenance screen!
vaishali
05-25-2011 1:04 PM
05-25-2011 1:36 PM
SAP's own periodic job scheduling capabilities are limited.
Some potential workarounds for your scenario, more or less nasty, expensive or complex:
- create specific holiday and factory calendars and use these in your jobs for skipping to next "workday"
- schedule multiple monthly jobs on the desired days
- write bespoke scheduling program (as suggested above and below)
- deploy more sophisticated, 3rd party job scheduling tools
Thomas
05-27-2011 7:44 AM
Thanks Thomas.
We will explore the option of using the holiday calendar as we are not using the same for any other module.
05-25-2011 2:32 PM
Hi ,
This is not SAP standard method But you try with below logic .
1.Write one more program with selection parameter on which date your original program has to run.
2.Inside this program if the selection parameters meet the condition with system date then trigger a event which will the schedule the original job.
3.Schedule the first program daily, if it meets the condition it will the trigger the event which will start the batch job which oyu required..
Regards,
Ravi