Friday 31 December 2021

Flexible Delivery Document Numbering in S/4HANA 2020

Requirement: Number Range for Delivery number must be determined based on following parameters.

Delivery Type

Shipping Point

Creation Year

Solution: In S/4HANA, new solution using CPF is available for determining number range for Delivery document numbering.

System will generate a CPF decision table with parameters as columns. We have to maintain different combinations of values and corresponding number range interval.

It is also possible to maintain number range prefixes.

1. Define parameters.

IMG -> Logistics Execution -> Shipping -> Basic Shipping Functions -> Configurable Parameters and Formulas in Shipping -> Define Parameter Catalog Entries for Flexible Delivery Document Numbering

SAP ABAP Exam Prep, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP 2021

Parameters Delivery Type and Shipping Point are defined by SAP and Data Source Routine 1 for filling these parameters is also delivered by SAP.But the parameter Creation Year is defined by us, and a custom Data Source Routine is needed for filling this parameter value.

2. Define custom Data Source Routine.

Note: This step is NOT needed if we want to use only SAP defined Parameters.As a first step we must create a BAdI implementation for BAdI definition BADI_LE_SHP_CPF_D01_DATA_SRC. In this BAdI implementation we will fill the value for parameter Creation Year.Important: BAdI Filter accepts value in the range 30000 – 99999 (Data Source Routine). This is the first place where we define new Data Source Routine.

SAP ABAP Exam Prep, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP 2021

After the BAdI implementation, go to t-code CPF_D01_DS_ROUT for assigning newly defined Data Source Routine to Usage D01 (Flexible Number Range for Delivery).

SAP ABAP Exam Prep, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP 2021

Select the newly defined Data Source Routine and assign parameter Creation Year to it.

SAP ABAP Exam Prep, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP 2021

3. Define formula to determine number range for delivery.

Till now we have defined all needed parameters. Now lets define the formula using these parameters.IMG -> Logistics Execution -> Shipping -> Basic Shipping Functions -> Configurable Parameters and Formulas in Shipping -> Define Formulas for Flexible Delivery Document Numbering

SAP ABAP Exam Prep, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP 2021

Assign required parameters to the formula.

SAP ABAP Exam Prep, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP 2021

The parameter NUMBERRANGERESULT is available by default in this list. This is parameter is a result parameter.

Formula Task SET_NUMBER_RANGE is available by default.

SAP ABAP Exam Prep, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP 2021

Select formula task SET_NUMBER_RANGE and assign parameters and define priority for them. While processing decision table, parameter having highest priority will be compared first.

SAP ABAP Exam Prep, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP 2021

Now our CPF decision table is ready. Maintain entries.

SAP ABAP Exam Prep, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP 2021

4. Define custom Routine for Flexible Delivery Document Numbering.

It is time to assign our formula to a Routine.

Define custom Routine.Note: Allowed range 3000000 to 3009999.IMG -> Logistics Execution -> Shipping -> Basic Shipping Functions -> System Modification -> Routines -> Define custom Routine for Flexible Delivery Document Numbering

SAP ABAP Exam Prep, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP 2021

Assign Formula to Routine.

SAP ABAP Exam Prep, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP 2021

5. Assign custom Routine to Delivery Document Type.

Assign the Routine to relevant Delivery Document Types.

IMG -> Logistics Execution -> Shipping -> Basic Shipping Functions -> Configurable Parameters and Formulas in Shipping -> Assign custom Routine to Delivery Document Type

SAP ABAP Exam Prep, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP 2021

Note: For this delivery type, number range 17 is the fallback when the Routine is failed to determine a number range.

Source: sap.com

No comments:

Post a Comment