S/4HANA Q2C Sales Flexibility – Determine Requested Delivery Date on Sales Document

In S/4HANA Cloud, the SAP best practice content provided by SAP normally fulfills basic E2E business requirement. Different from S/4HANA On-Prem or S/4HANA Private Cloud where customer has full access to the backend system (e.g. SPRO) to change configuration, customer uses SSCUI apps to change some configuration settings in S/4HANA Cloud. However, most SSCUI settings are only defined in the design time and it is difficult to handle different process variants in Q2C order process.

With help of CPF tool (Configurable Parameters & Formulas), it is possible to define business rules in S/4HANA Cloud to influence different aspects of sales order process at runtime.

This blog shows CPF usage “S02” to determine requested delivery date on sales order header based on flexible business rules defined in CPF decision table. Please find detail information in SAP help (link).

The field “Requested Delivery Date” in sales order header is used to capture the requested delivery date by customer. This date can be current date, or proposed by system based on certain rules. Following customizing settings are defined in the sales order type to influence requested delivery date calculation.

Requested%20Delivery%20Date%20Settings%20in%20Order%20Type

Requested Delivery Date Settings in Order Type

These settings are not sufficient to fulfill customer’s requirement to calculate the requested delivery date. For example, due to different sales area the offset of requested delivery date would be different. Customer would like to have 5 days offset for one sales area and set 10 days offset to another sales area.

In this example, I’d like to show the detail steps of using CPF to define requested delivery date offset based on different sales office via business rules.

Following configurations need to be defined to enable the flexible number range feature. Generic user “BPC_EXPERT” is used to define required configurations via SSCUI.

Define Factory Calendar Rules

The factory calendar shall always be considered when determining date. Therefore, before defining business rules for requested delivery date, it makes sense to define what factory calendar should be used in the order process.

Go to SSCUI 103829 “Define Rules to Determine Factory Calendar” to define factory calendar determination sequence.

Define%20Calendar%20Rule%20ID

Define Calendar Rule ID

Define the factory calendar determination priority as Sales Org -> Sold-to Party -> Calendar Rule. This means the factory calendar will be determined from sales organization of sales order as the first priority, then use factory calendar from sold-to party if no factory calendar is determined from sales organization. The default factory calendar will be used if no factory calendar is determined from both sales organization and sold-to party.

Factory%20Calendar%20Rule%20Priority

Factory Calendar Rule Priority

Define Parameter Catalog for Requested Delivery Date

Open the SSCUI 103827 “Define Parameter Catalog for Requested Delivery Date” to define parameters which will be used to build up the CPF decision table.

Define%20Parameter%20Catalog

Define Parameter Catalog

There are some standard parameters available so that customer can build up business rules based on these parameters.

Define Formulas for Requested Delivery Date

Open the SSCUI 103828 “Define Formulas for Requested Delivery Date” to define CPF formulas.

Define Formulas

Define a new CPF formula and specify the formula ID

Define%20CPF%20Formula

Define CPF Formula

Assign Formula Parameters

Select the formula ID and double click the sub-folder “Assign Formula Parameters” to assign parameter

Assign%20Formula%20Parameters

Assign Formula Parameters

Define Formula Tasks

Click into the sub-folder “Formula Tasks” to define formula tasks

Define%20Formula%20Tasks

Define Formula Tasks

The standard usage task “SET_REQD_DELIV_DATE” is available to determine the requested delivery type. Routine 1 means the CPF decision table is used for this formula.

Define Parameter Priority

Click into the sub-folder “Assign Parameter Priority” to set the priority of parameter which makes the column sequence of decision table.

Assign%20Parameter%20Priority

Assign Parameter Priority

Define Decision Table

The next step is to define business rules in decision table. Define business rules as below:

Define%20Decision%20Table

Define Decision Table

In the decision table, I set 5 days offset for sales office 100 and sales group 100, and 10 days offset for sales office 120 and sales group 120, and 30 days offset for sales office 130 and sales group 130.

Define Custom Routines for Requested Delivery Date

Go to SSCUI 103830 “Define Custom Routines for Requested Delivery Date in Sales Documents” to define custom routines.

Define%20Custom%20Routine

Define Custom Routine

Select the routine number and link the CPF formula to the routine number

Assign%20Formula%20to%20Custom%20Routine

Assign Formula to Custom Routine

Assign Custom Routines to Sales Document Types

Open the SSCUI 103823 “Assign Custom Routines to Sales Document Types” to link the custom routine to sales document type.

Assign%20Custom%20Routine%20to%20Order%20Type

Assign Custom Routine to Order Type

In this example, select the custom routine and assign it to the standard order type “OR”.

Log onto S/4HANA Cloud system with generic user “INTERNAL_SALES_REP”.

Create Sales Order with Sales Office 100

Create a sales order via VA01, and provide required information like sold-to party, customer reference, and material

Sales%20Order%20Creation%20-%20VA01

Sales Order Creation – VA01

Because there is no sales office/sales group determined in sales order, the requested delivery date is determined by current system date.

Go to sales order header to set sales office and sales group.

Set%20Sales%20Office%20and%20Sales%20Group

Set Sales Office and Sales Group

Go back to the sales order overview page to check the requested delivery date.Requested%20Delivery%20Date%20Determination

Requested Delivery Date Determination

The offset 5 days is considered to calculate the requested delivery date when sales office/sales group is 100/100.

Create Sales Order with Sales Office 120

Open the sales order Fiori app to create sales order.

Create%20Sales%20Order

Create Sales Order

The current date is used as requested delivery date if no sales office/sales group is specified.

Current%20Date%20is%20Used%20for%20Requested%20Delivery%20Date

Current Date is Used for Requested Delivery Date

Specify the sales office and sales group

Determine%20Requested%20Delivery%20Date

Determine Requested Delivery Date

The 10 days offset is used to determine the requested delivery date when sales office and sales group 120/120 is specified in sales order.

The CPF provides more flexibility to influence sales document process at runtime without enhancing core logic. It is friendly to the business user and citizen developers who may lack of ABAP experience of implementing Cloud BAdIs.

The CPF usage “S02” only controls requested delivery date on sales order header level, and the logic will not be triggered in the changing mode. Please find detail feature described in the SAP help document (link).