Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
kaidehmann
Advisor
Advisor
Do you develop applications in SAP BTP, ABAP environment, and as part of your implementation, do you need to validate or calculate dates based on working days or holidays?

To solve such tasks, the SAP BTP, ABAP environment provides the so-called factory calendar. A factory calendar is based on a country/region-specific holiday calendar and defines which days are working days, for example, Monday to Friday, and location-specific rules.

SAP BTP, ABAP environment systems come with predefined holidays, holiday calendars, and factory calendars. But you can also maintain your own factory calendars. To view and edit them, the following Fiori apps are provided: Maintain Holidays, Maintain Holiday Calendars, and Maintain Factory Calendars. For more information regarding these Fiori apps, please check the Factory Calendar documentation.

If your factory calendars are maintained in an existing on-premises system already, you can use the pull integration for the factory calendar to pull the data from your on-premises system to the SAP BTP, ABAP environment system to avoid double maintenance.

Moreover, to access the factory calendar from your application, the SAP BTP, ABAP environment provides class-based APIs and CDS views. You can use these APIs to validate if a certain date is a working day, or calculate the next working day, for instance. For more information about these APIs, check the Factory Calendar documentation.

To see the factory calendar in action, check out the brand-new Use Factory Calendars in a Business Object in SAP BTP, ABAP environment tutorial. Based on predefined factory calendars, this tutorial shows you how to use factory calendars in a business object, add a value help for selecting a factory calendar, implement validations and calculations in the behavior implementation, and utilize CDS scalar functions to perform calculations in CDS using HANA built-in SQL functions.