In SAP, Factory Calendar basically distinguishes between working days and non-working days (e.g. holidays) for any location. Holiday Calendar is the ones which distinguish between working days and public holidays. First Public Holidays are created which are assigned to Holiday Calendar and then Holiday Calendar is assigned to a Factory Calendar. Factory Calendar is maintained in both SAP ECC and SAP APO. However as we know SAP APO is based on time series objects so we need to have time streams generated in APO on the basis of Factory Calendars which specify the working and non-working planning buckets.

Both the Factory calendars in SAP R/3 and SAP PAO should be in sync. Planning time streams which are based on these factory/holiday calendars such as planning buckets should be in sync between ECC and APO systems.

This document provides a method to automate the process of factory calendar update from ECC to APO. There are basically two methods of automation –

Running the steps of automation via scheduled batch jobs

Creating a process chain with the steps arranged in sequence for updating the factory calendar in APO. This process chain can either be scheduled to run on a periodic basis (Periodicity can be defined as per business requirement) or on an ad-hoc basis too.

The automation of Factory Calendar update in APO from ECC involves following steps –

1. Update Factory Calendars in APO from ECC

2. Update Time Streams in APO

3. Update Resource Capacity in Live Cache in APO (This could be an optional step depending if the business is using Capacity Planning)

The above step will make the factory calendar between SAP ECC and SAP APO in sync – For example if any day which was previously a non-working day has been made to a working day in factory calendar in SAP ECC, same changes will get reflected in factory calendar in SAP APO too.

We also have a program for this same process – program Name – “RSIMPCUST”. We can view the same via SE38. Here if we load the variant which has been created before we will get similar settings. This program would be used subsequently to be run via scheduled batch jobs or process chains.

Step 2 – Update Time Streams in APO

Transaction – /SAPAPO/CALENDAR

Here one needs to populate the Time Stream ID which is being used in business and then click Change.

After the user clicks Change this will then prompt the user to the below screen. Once at this screen user will then click the Periods icon to update the factory calendar in SAP APO. User should then hit save and then validate results in the Periods tab.

The above step will make the time stream updated in SAP APO and keep it in sync with factory calendar between SAP APO and SAP ECC.

We also have a program for this same process – program Name – “/SAPAPO/TIMESTREAM_UPDATE”. We can view the same via SE38.

Here we can just give the factory calendar and Time stream Id details and the program would automatically update the Time stream in SAP APO. This program would be used subsequently to be run via scheduled batch jobs or process chains.

Step 3 – Update Resource Capacity in Live Cache in APO

Transaction – /SAPAPO/REST02

Here, depending on the scenario either we can give the selected resource name if available or a generic criteria also.

The above step will extend the time stream for resources and update the same in Livecache in SAP APO.

We also have a program for this same process – program Name – “/SAPAPO/CRES_CREATE_LC_RES”. We can view the same via SE38.

Here we can just give the same parameters and save it in a variant. This program would be used subsequently to be run via scheduled batch jobs or process chains.

Automation Steps

1 Automation via Batch Job

Transaction – SM36

Here, we can add all the three steps which were defined earlier sequentially as three steps in the batch job as shown below. Also we can define specific date time also when we want this job to be run.

Once the job is triggered, we can monitor the same via SM37 as shown below –

2. Automation via Process Chain

Transaction – RSPC

Go to change mode and create new and add name of process chain with start variant name as shown below –

Then from the left side we select “ABAP Program” and add program for Calendar Sync which is the step 1 as explained above and connect it to the first step as shown below –

Similarly we repeat the above step for programs which were part of step 2 and step 3 as explained above and connect them sequentially. Final process chain would look as shown below. Before running the process chain we need to activate the process chain with the icon as highlighted below –

Summary

Automation of Factory Calendar update from ECC to SAP APO is better with respect to manual update. In case of manual update, if manual action is not taken there can be substantial time gap before the two systems can be in sync thereby leading to data discrepancy.

Entire process can be updated with the help of batch jobs or process chain as per requirement. This will transfer all factory calendars and update the time stream in APO. And thereby avoiding any data discrepancy between the systems.