Sometimes the consultants come to the Basis guy asking to do unusual things but required by the business. I ain't different and some requirements come and I would like to share with you one of them: schedule not supported by SAP standard.
Requirement
The project needs is following:
- Hourly job
- Must run between 03:00am and noon.
As known by Basis, this kind schedule isn't supported by SAP. If you set an hourly job there isn't option for time frame, window or anything like. After think a little about possible solutions, I conclude there are only 2 possible solutions without ABAP development:
- Schedule multiple daily jobs, one for each hour
- Schedule single jobs with external trigger
For the first solution it is easily configured but with high maintenance effort, because if for some reason the business decided to add steps or even change the variant, will exist lots of different jobs to change.
Jobs and External triggers
The default job triggers are described bellow:
Immediate
This runs the job immediately you save the job
Date/Time
Set an schedule to the job (specified date and time)
After Job
Run the job after another job.
After event
Run the job after an occurrence of an SAP event <--- This is the matter of the Blog!
At operational mode
Run the job only determined operational mode is running. This option can be used if the job schedule is the same of the operational mode configured.
SAP Events
In SAP Netweaver some events are triggered for too many different reasons. The standard installation comes with lots of pre configured events and allows to create your own events. Following the SAP standardization create your own starting with "Z" or "Y".
SM62
On SM62, click on new. The following window pops up:
Set the event's name (starting by Z or Y) and a description for your event.
SM36
The matter of this blog is not to teach you how to schedule a job but how to make it using a special schedule. Due this, I will only take care about whats change on the regular configuration. To use the event, click on after event. This will enable the After Event area to be filed up. Select your event from the math box and do not forget to set it as Periodic Job.
Windows Task Scheduler
My servers are windows servers, but this setup can be done in any operational system (on linux use the crontab and etc). The most important is to understand the procedure by itself than only follow a procedure. On windows task scheduler create a new task and set your schedule. Here I will show you an example. Adjust it for in accordance of your need.
And that is! Your special schedule is set successfully on your SAP system. Keep in your mind from now the trigger is the Windows Task Scheduler instead the SAP by itself.
I hope this would help you and see ya next time!
Frederich Murador
SAP Basis administrator