Read QSandS_FactoryCalendar.pdf text version

September 2008 ·

Simplify Your Month End by Using the Factory Calendar for Batch Job Scheduling

by Rohana Gunawardena, SAP Practice Director, Quality Systems & Software

Examinehowafactorycalendaralignedtothefiscalcalendarcansimplifymonth-endbatchjob scheduling,especiallyifyouarenotusingScheduleManagerandClosingCockpit.Understand howtocreateafactorycalendarthatmatchesyourfiscalcalendarandhowtocreateabatch jobthatfollowsthiscalendar.

>> Key Concept

Everycompanyislookingfortoolsto helpspeeduptheperiod-endclosing process.Duringperiod-endclosing, acompanyisunderpressureto produceaccuratefinancialinformation intheshortestpossibleperiod.To expeditetheprocessthecompany shouldaimtoeliminateerror-prone andtime-consumingtasks.Oneway ofdoingthisisbyautomatingtasks. Customfactorycalendarscanhelp supportthisautomationprocess andworkinconjunctionwithtools suchasScheduleManagerand ClosingCockpit. Evenwhenusingthesetools,you needtohaveafactorycalendarthat matchesyourfiscalcalendar.There isnotanautomatictooltolinkfactory calendarstoafiscalcalendar.You havetosetthisupmanuallyusing transactionSCAL.Transportingthe factorycalendarhasspecialconsiderationsanditisbesttomanually createitineachsystemandnot transport.Whencreatingafactory calendartomatchafiscalcalendar, especiallyonethatdoesnotfollow thenormalyear(e.g.,4-4-5periods), youneedtousethespecialrules sectionofSCALconfiguration. year 2008, which covers the last 10 months of fiscal year 2008 and the first 2 months of fiscal year 2009. You use transaction SCAL to create factory calendars. The most common use of these for workforce planning, HR, MRP

Imagine a company that uses a 4-4-5 calendar. The 4-4-5 fiscal calendar is a common calendar structure for some industries, such as manufacturing and retail. Its major advantage over a regular calendar is that the end date of the period is always the same day of the week, which is useful for shift or manufacturing planning. The 4-4-5 calendar divides a year into four quarters. Each quarter has 13 weeks, which are grouped into two 4-week months and one 5-week month. The grouping of 13 weeks may be set up as 5-4-4 weeks or 4-5-4 weeks, but the 4-4-5 is the most common arrangement. One disadvantage of the 4-4-5 calendar is that it has 364 days, so approximately every five years there will be a 53-week year, which can make year-to-year comparison difficult. You use the factory calendar in the SAP system for many different processes, such as customer billing dates, workforce planning, Materials Requirements Planning (MRP) scheduling, and batch job control. I will focus on the last of these. Consider a batch job that needs to be run on the last day of the fiscal period. If you set it up using transaction SM36 as a repetitive batch job you see that the options provided do not match this requirement (i.e., can have the job repeat once a month). If the last day of the month is not always on the same date, you cannot set

up the repetition cycle with the settings provided in transaction SM36. By creating a factory calendar that matches your fiscal calendar and then using the restrict by factory calendar option in transaction SM36 you can set up a batch job that runs on exactly the close period date you require. I'll show you how to do this in configuration, explore some other tools you can use, and finish with some tips and tricks.


Let's start by creating a factory calendar that has one working day which is always the last day of the fiscal period. In this example, I will set up the calendar for a company that uses a 4-4-5 fiscal calendar that starts in November. In this case its fiscal 2008 calendar runs from October 29, 2007, to October 26, 2008 (Figure 1 on the next page). The last day of the fiscal period is always a Sunday. Table 1 on the next page shows the nomenclature that the company used to identify days relative to the last day of the fiscal period (-) negative days before month end and (+) positive days after the month end. For example, day +1 is the first day after the fiscal period ends. You define the fiscal year using transaction OB29 (Figure 2 on the next page). Figure 3 shows the configuration for calendar



planning, and so on, resembles a regular calendar with the days Monday-Friday designated as work days and then a holiday calendar assigned as well to ensure that work does not occur on holidays such as New Year's Day. Unfortunately there is no standard tool in the SAP system to translate a fiscal calendar to a factory calendar. Note there are multiple transaction codes that call the screen from transaction SCAL (Table 2). You normally set up calendars on the basis of five working days plus public holidays. However, you can set them up using special rules, in which you explicitly define which days will be considered work days for the calendar. This is ideal for setting up a calendar for a specific day once a month, such as the last day of the fiscal period. To create a new factory calendar, from transaction SCAL select the Factory calendar radio button and then click on the change (pencil) icon. Note the change mode option is only available if your SAP system is open for cross-client customizing, a setting maintained by your Basis team in table T000. After you enter change mode, the system displays a list of existing calendars. Click on the new calendar (blank sheet of paper) icon to create a new calendar (Figure 3). In the detail screen enter the calendar ID, its description, and the years for which it is valid. Because you're creating the calendar to use special rules only, you don't need to enter a holiday calendar or define workdays on this screen. Click on the Special rules button and in the screen that appears enter the specific dates for which you want the calendar to be active. Check the Workday check box for these dates (Figure 4 on page 20). In the example, dates that map to D+1 are workdays. To see what these dates look like in a calendar format from the overview screen, select the calendar that you want

Figure 1

Examplefiscal2008calendar,starting10/29/2007andending 10/26/2008

Month 1

Mon -5 Mon +1

Table 1

Tue -4 Tue +2

Wed -3 Wed +3

Thu -2

Month 2

Fri -1 Fri +5

Sat -0

Sun +0

Thu +4


Figure 2



© 2008 Financials ExpertReproductionprohibited.Allrightsreserved.

September 2008 ·

to review and click on the Calendar button in Figure 3 to see the list of years that are configured (Figure 5 on the next page). Double-click on a year to see the work dates in a calendar format (Figure 6 on the next page). Workdays are highlighted in yellow on your screen and non-working days are in green. The data entry process for setting up the factory calendars can be quite time consuming and error prone. You should use a tool such as Legacy System Migration Workbench (LSMW), Computer Aided Test Tool (CATT), or extended Computer

Transaction code Description

Aided Test Tool (eCATT) to make your calendar entries. With these, you can prepare your data in Excel and then upload the data to make multiple calendar configuration a relatively painless process. To find out more about these tools, read Mitresh Kundalia's articles, "Fast Data Conversion, Migration, and Updates for Functional Analysts with LSMW" (Volume 2, Number 7) and "Use CATT to Test Your End-to-End Business Processes" (Volume 4, Number 2) in the Financials Expert knowledgebase at In the above example, the to and from

days were the same so the calendar only had one working day per fiscal period, but this does not need to be the case. See Figure 7 on page 19 for examples of multi-day calendars that have been configured. You might need a batch job run from the Friday before close to the Monday after close, in this case day -1 to day +1. Varying the to and from dates generates a suitable factory calendar (Figure 8 on page 19). When you create a transport for a calendar using transaction SCAL, it does not just transport the changes you have made like a regular transport, but transports all settings contained in transaction SCAL all public holidays, holiday calendars, and factory calendars. Unless you are sure that the entire configuration is correct, SAP recommends that you do not transport the calendar settings but manually make the changes in each system as you progress through your development, quality assurance, and production transport pipeline. If you use a tool such as LSMW, CATT, or eCATT to make your calendar entries for special rules, this can be a relatively painless process. In each SAP system in your transport pipeline, you need to have your Basis team open the system for cross-client customizing.


Table 2

CSDtab.customercalendar CSDtab.billingschedules Factorycalendar Maintainpublicholidays Maintainpublicholidaycalendar Maintainfactorycalendar Maintainpublicholidays Maintainpublicholidaycalendar Maintainfactorycalendar


Transaction SM36 Job Scheduling

You can link a batch job to a factory calendar using transaction SM36. In the initial screen of transaction SM36, enter the job name and then click on the Start condition button to enter the dates (Figure 9 on page 21). To complete a batch job, you need to set up both the start condition and steps, but I will not cover the setup of batch job steps in this article. After you click on the Start condition button, the pop-up screen shown in Figure 10 on page 21 appears. Enter the date and time for the first job run and select the

Figure 3

Calendarssetuptoassistwithbatchjobschedulingbasedonthefiscal calendar



Periodic job check box. Then click on the Period values button to bring up the Period Values pop-up screen. Click on the Daily button and then click on the save icon. This sends you back to Figure 9. Do not select Monthly because this implies repetition based on the regular calendar. In the case of a 4-4-5 calendar the interval between two dates, P01 D+1 to P02 D+1, is 28 days, which is less than most calendar months, which are 30 or 31 days. After returning to the Start Time pop-up screen (Figure 10), click on the Restrictions button to bring up the Start Date Restrictions pop-up screen. Enter the factory calendar and restrict the batch job to run only on the workdays defined in this calendar. Select the radio button Move job to next workday; the default value Always execute job does not restrict the job. Click on the Transfer button to save the settings and return to the start conditions pop-up screen. After returning to the Start Time screen, click on the save icon to go back to transaction SM36. You now see the planned start date and the job frequency (Figure 11 on page 22). Remember the daily frequency is restricted to workdays defined in the factory calendar. To complete the batch job setup, define the steps for the batch job and then follow Job>Save from the transaction SM36 initial screen.

the Schedule Manager overview screen, follow Task List>Create and the new task list pop-up screen appears (Figure 12 on page 22). In the task list header enter the required

factory calendar (Figure 13 on page 22). Note that after you create the task list you cannot change the calendar assignment. To see the calendar settings for an existing task list, follow Goto>Header from the menu.

Figure 4


Figure 5


Schedule Manager and Closing Cockpit

You can use two tools for scheduling period-end closing activities: Schedule Manager and Closing Cockpit. Schedule Manager is available with standard SAP ERP Central Component (ECC) or R/3 Release 4.6 or higher. When configuring Schedule Manager, you need to assign a calendar to each task list. To do this, you can use the factory calendars configured for workday to ensure the correct scheduling of the task list. From

Figure 6

Calendaroverviewdisplaywithworkingdayshighlightedinyellowonthe screen(01/28,02/25,03/31,04/28,05/26)


© 2008 Financials ExpertReproductionprohibited.Allrightsreserved.

September 2008 ·

To find out more about Schedule Manager, see Anurag Barua's article "Configure and Manage All Period-End Closing Activities with Schedule Manager" (Volume 6, Number 3) in the Financials Expert knowledgebase at

Figure 7

Factorycalendarssetuptosupportbatchjobswhichneedtorunon multipledaysoftheclose

Figure 8


Closing Cockpit is a tool available with ECC 5.0 or higher. You typically use it to schedule period-end closing activities. It has a richer functionality than the previously mentioned Schedule Manager. For more details on the tool see Gary Fullmer's articles "SAP Closing Cockpit in mySAP ERP Automates Fast Close" (Volume 6, Number 2) and "Set Up SAP Closing Cockpit for Speedier and Better-Controlled Financial Closings in 5 Steps" (Volume 7, Number 2) in the Financials Expert knowledgebase at

Tips and Tricks

Here are three tips and tricks you can perform with calendars. Change calendars. Some situations require that you change your calendars, such as if your company close coincides with a major holiday and you decide to push back the close cycle by one day. In this case, you need to make sure all calendar changes are done at least one fiscal period in advance. The reason for this is that the next date for a repetitive batch job is determined when it runs, so if a job is always run on day -0 then the specific date for fiscal period 4 day -0 is chosen on fiscal period 3 day -0. If you change the factory calendar for fiscal period 4 day -0 after the job has run you will not affect the start date of the job and it will run as if the calendar had not been changed. Report variants. When you schedule reports using transaction SM36, Schedule Manager, or Closing Cockpit, you often need to ensure the selection variants you have set up for the reports change their values. For example, the reports selection screen has fiscal year and period as input parameters, and the report has a key date

Figure 9


Figure 10




that should be the last day of the fiscal period. If you create the variant in P01/2008 and save it with these values when you run it for P02/2008, the system uses the incorFigure 11

TransactionSM36initialscreenupdatedwithstartdateandtimeandjob frequency

rect value P01/2008 unless you manually update the variant each period. You can simplify this process a great deal by using variant variables, sometimes referred to as TVARV or TVARVC variables. For more information on this, read Mitresh Kundalia's article "Use Your Program Variants More Effectively with the Help of TVARV Variables" (Volume 4, Number 3) in the Financials Expert knowledgebase at www. Refresh calendar buffer. When you

Figure 12


make changes to an existing factory calendar you may notice that the changes do not take effect immediately. This is because the system buffers the calendars. To make sure that the changes are available immediately, use the refresh calendar option in transaction SCAL. This is the same as executing ABAP report RSSCALT2. n

Figure 13


Rohana Gunawardena is the SAP practice director of Quality Systems & Software, a specialist SAP consulting firm. Rohana has been working with SAP systems since 1992, focusing on the order-to-cash process with emphasis on global rollouts, business segment reporting, cross-module integration, and the financial impact of Supply Chain Management transactions. He has helped multiple clients on detailed system correction projects, activating group currency, and clean up of inter-company accounting transactions. Rohana has spoken at many SAP conferences and has published more than 20 articles on various aspects of SAP. He is a Fellow of the Institute of Chartered Accountants in England & Wales. You may contact Rohana at [email protected]


© 2008 Financials ExpertReproductionprohibited.Allrightsreserved.


6 pages

Report File (DMCA)

Our content is added by our users. We aim to remove reported files within 1 working day. Please use this link to notify us:

Report this file as copyright or inappropriate


Notice: fwrite(): send of 203 bytes failed with errno=32 Broken pipe in /home/ on line 531