Quantcast
Channel: ERP | SAP Expert
Viewing all articles
Browse latest Browse all 75

Unusual use of usual calendar in SAP

$
0
0

SAP Expert has written recently about the methods to maintain calendars in SAP. It was explained there that the logistics calendar consists of holidays, holiday calendar and a list of working days.

What is the most common use of the calendars? You are right, there are many. Just to list a few:

  • calculate payroll
  • plan work for staff
  • plan SAP background jobs

The unusual purpose

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:

  • Period 1 starts on the 1st of January and runs for 4 weeks.
  • Period 2 starts on the 29th of January and runs for 5 weeks.
  • Period 3 starts on the 5th of March and runs for 4 weeks.
  • Period 4 starts on the 2nd of April and runs for 4 weeks.
  • And so on…

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.

Creating the Calendar with Special Rules

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.

Logistics calendar

Logistics calendar

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″.

Special rule in the calendar

Special rule in the calendar

Confirm the creation of the rule.

Now do the same for the following dates:

  • 28.01.2014, naming it “End of Period 1″.
  • 29.01.2014, naming it “Start of Period 2″.
  • 04.03.2014, naming it “End of Period 2″.
  • and so on.

At the end, your list should look like this:

List of special rules

List of special rules

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.

Using the calendar

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.

Setup of variable in the variant

Setup of variable in the variant

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.

Calendar in variable calculation

Calendar in variable calculation

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.

FBL3N with variant applied

FBL3N with variant applied (click to enlarge)

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?


Viewing all articles
Browse latest Browse all 75

Trending Articles