You are on page 1of 12

Scheduling a background job using factory calendar

By Savitha Madhavagiri, CSC India

Consider a batch job that needs to be run on every 3 rd Saturday in a month.

If you set it up using transaction SM36 as a repetitive batch job you see that the options provided do not match this requirement.

We can achieve this by creating a factory calendar then using the factory calendar option in SM36.

Let us see below how we configure these settings.

Configuration:

Create a new factory calendar that has one working day which is always the 3 rd Saturday of the month.

You use transaction SCAL to create factory calendars. Select the Factory calendar radio button and then click on the change icon.

Scheduling a background job using factory calendar By Savitha Madhavagiri, CSC India Consider a batch job
Scheduling a background job using factory calendar By Savitha Madhavagiri, CSC India Consider a batch job

In the next screen enter the calendar ID, its description, and the years for which it is valid.

In the next screen enter the calendar ID, its description, and the years for which it

As we are going to use Special rules only, we don’t need to enter a holiday calendar or define workdays on this screen. Press Save and then click on “Special rules”.

In the next screen that appears enter the specific dates for which you want the calendar to be active. Tick the Workday check box for these dates.

Press save and go back to Overview screen. Click on the Calendar button to see what

Press save and go back to Overview screen. Click on the Calendar button to see what these dates look like in a calendar format.

Press save and go back to Overview screen. Click on the Calendar button to see what
Double-click on a year to see the work dates in a calendar format. Workdays are highlighted

Double-click on a year to see the work dates in a calendar format. Workdays are highlighted in yellow on your screen and non-working days are in green. In our example we have set dates only for 3 months, so you see no of workdays as 3 for year 2009.

Double-click on a year to see the work dates in a calendar format. Workdays are highlighted

By following the above steps we have set up a new factory calendar Z4.

Job scheduling in SM36:

Create a new job ZTEST and click on “Start condition”. Press “Date/Time” and tick the Periodic job check box. Click on the Monthly button and press Save.

Create a new job ZTEST and click on “Start condition”. Press “Date/Time” and tick the Periodic

Then click on “Restrictions” button. In the pop-up of Start date restrictions enter calendar id as Z4 and select Move job to next working day option which restricts the job.

Then press transfer to save the settings and go back to pop-up.

Then press transfer to save the settings and go back to pop-up.

Then press transfer to save the settings and go back to pop-up.

Press ok and return to main screen of SM36.

Press ok and return to main screen of SM36. We can see the job planned startFACTORY CALENDAR FOR PLANTS FACTORY CALENDAR A factory calendar distinguishes between working days and non-working days. Dependencies If you have entered an exception rule for non-working days and have selected factory calendar, you must enter a factory calendarthat is relevant to your company. T.CODE: - OY05 PATH: - SPRO -> IMG ->TIME MANAGEMENT -> WORK SCHEDULES -> DEFINE PUBLIC HOLIDAY CLASSES Steps to create Factory Calender 1. Define public holidays. " id="pdf-obj-6-4" src="pdf-obj-6-4.jpg">

We can see the job planned start date is set to 15.08.2009(3 rd Saturday in August) and frequency is set to Monthly. Define the steps and complete the job set up by pressing save.

FACTORY CALENDAR

A factory calendar distinguishes between working days and non-working days.

Dependencies

If you have entered an exception rule for non-working days and have selected factory calendar, you must enter a factory calendarthat is relevant to your company.

T.CODE: - OY05

PATH: - SPRO -> IMG ->TIME MANAGEMENT -> WORK SCHEDULES -> DEFINE PUBLIC HOLIDAY CLASSES

Steps to create Factory Calender

1. Define public holidays.

2. Define Holiday Calendar and assign public holidays to holiday calendar.

2. Define Holiday Calendar and assign public holidays to holiday calendar.

3.Define Factory Calendar, select the working days and assign holiday calendar to factory calendar.

3.Define Factory Calendar, select the working days and assign holiday calendar to factory calendar.