SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
⤢ Open full site

Use Factory Calendars in a Business Object in SAP BTP ABAP environment

Create a business object that consumes factory calendars using ABAP Cloud.

Overview

🎓 intermediate 25 min. SAP BTP ABAP EnvironmentIntermediateABAP DevelopmentSAP Business Technology Platform

You will learn

  • How to add a value help for factory calendars
  • How to access factory calendar information from your ABAP code
  • How to use factory calendars in CDS via CDS scalar functions
Achim Seubert A Achim Seubert March 27, 2026
Created by November 27, 2023
Contributors

Prerequisites

Prerequisites

  • You have a business user with developer authorization (business role SAP_BR_DEVELOPER) in the system.
  • You have downloaded and installed the latest ABAP Development Tools (ADT) on the latest Eclipse© platform.
  • You have created an ABAP Cloud project for the system in ADT.

Steps

Intro

The business scenario used in this tutorial is that of an online shop or ordering application. Users can create orders, providing as input a production start date, the number of days required for the order to be produced, as well as one of the available factory calendars. This information is used by the application to dynamically calculate the production end date, taking into account the working days defined by the specified factory calendar. The user can further input a delivery date, which will be validated using the same factory calendar to make sure that this date is not earlier than the calculated production end date.

Please keep in mind that this tutorial uses standard, SAP-delivered factory calendars. The creation and configuration of custom factory calendars is not part of this tutorial.

In this tutorial, wherever ### appears, use a number (e.g., 000).

For more information on scalar functions, please see CDS Scalar Functions | SAP Help Portal.

For more information on factory calendars, please see Maintain Factory Calendars | SAP Help Portal. For accessing factory calendar related information from your ABAP code, see Factory Calendar | SAP Help Portal.


Step 1 Create your own ABAP Package

Create your exercise package. This ABAP package will contain all the artefacts that will be created in this tutorial.

  1. In ADT, go to the Project Explorer, right-click on the package ZLOCAL, and select New > ABAP Package from the context menu.

  2. Maintain the required information:

    1. Name: `ZFACTORYORDER_###`
  3. Description: `Factory Calendar Tutorial`
  4. Select the box **Add to favourite packages**
  5. Click Next.

  6. The ABAP Package properties remain as is. Click Next.

  7. No transport request is necessary, as change recording is not enabled. Click Finish.

Step 2 Create a Database Table
+
Step 3 Create a Business Object
+
Step 4 Define a Custom Value Help for choosing a Factory Calendar
+
Step 5 Define a Validation for the Factory Calendar Selection
+
Step 6 Create a Scalar Function Definition
+
Step 7 Create a Scalar Function Implementation Reference
+
Step 8 Implement the Logic for the Scalar Function
+
Step 9 Consume the Scalar Function in your Business Object
+
Step 10 Define a Validation using the chosen Factory Calendar
+
Step 11 Summary
+
Step 12 Test yourself
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 12
1. Create your own ABAP Package 2. Create a Database Table 3. Create a Business Object 4. Define a Custom Value Help for choosing a Factory Calendar 5. Define a Validation for the Factory Calendar Selection 6. Create a Scalar Function Definition 7. Create a Scalar Function Implementation Reference 8. Implement the Logic for the Scalar Function 9. Consume the Scalar Function in your Business Object 10. Define a Validation using the chosen Factory Calendar 11. Summary 12. Test yourself

Learn more →