What is the most common use of the calendars? You are right, there are many. Just to list a few:
For most of us, the calendar has a pretty simple structure. There are years, there are 12 months in each year, there are 28 to 31 days in each month.
But not all the activities go well with that simple structure. The difficulty comes into place when you need to account for weeks and/or irregular periods. Weeks may be split between months, and even between years. Some activities may have an irregular period.
One of the possible examples is the 4-5-4 or 4-4-5 fiscal year calendar, so widely used by Retail companies, and even some non-Retail companies where like-for-like comparison is quintessential.
What is 4-5-4 or 4-4-5? This is a split of fiscal periods into chunks of 4, 5, and 4 weeks in a quarter. Or 4, 4 and 5, if you want. For example:
Your fiscal year then consists of 4 quarters, in which each quarter has exactly 13 weeks.
I leave it to you to think about benefits of this approach to a fiscal year split.
Now imagine you need to plan SAP background jobs to cover exactly each of the periods. Of course, you can schedule it to start on a particular day of the month which definitely falls within a period, for example the 10th. However, how can you tell the system that you need to select dates between the 1st and 28th of January for the 1st period, and between the 29th of January and 5th of March for the 2nd period? There is no fixed number of days between the execution date and start/end dates of the period.
Here comes the calendar! Apart from elements listed above, holidays, holiday calendars and a list of working days, it may contain “special rules”. These special rules allow you to define one-off working or holiday days outside of the normal schedule.
Let’s go into transaction SCAL and create a Logistics Calendar.
Give it a name, a code, a validity range, and leave all other fields empty. There is no default holidays calendar, there are no default working days.
Save your data.
Now click the “Special rules” button. It gives you an option to add one-off rules to the calendar. Start with creating a new rule. Specify the start and end date for the rule as the same day, for example 01.01.2014, tick the “Workday” checkbox and give it a description “Start of Period 1”.
Confirm the creation of the rule.
Now do the same for the following dates:
At the end, your list should look like this:
It includes start and end dates of each irregular period.
Now save your data and leave transaction SCAL.
You can now move your configuration, if this is required. Use the method described in this article by SAP Expert.
Now let’s create a variant that would use the calendar we have just created.
My example uses the FBL3N transaction, but you may apply the same approach to any report where date range selection is required.
Specify the Dynamic Date Calculation option for that field in the variant and select “Date – xxx, Date + yyy (work days)” in the list of variables.
When you make this selection, another pop-up window appears. Here you specify “3” as xxx value and “2-” as yyy value. Factory calendar should be specified as the one we have created on the previous step.
Confirm your selection and save the variant.
Now you can apply the variant and see that SAP automatically calculates the date range from the calendar.
The last step is to schedule the job that would use the variant we have just created. Make it run on the date which always falls inside the period.
Now, when the job runs, it will use the dates from your irregular intervals.
What are the other unusual applications of SAP Calendars you know?