Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
Showing results for 
Search instead for 
Did you mean: 
This blog post describes the steps to configure a formula for the determination of internal partner number via CPF.

CPF(Configurable Parameters and Formulas) is developed to provide users the possibility to create flexible formulas. The main object within CPF is the CPF Formula.

A formula consists of a set of freely configurable parameters which are needed for the execution of the formula and a set of (usage-dependent) tasks defining what is the formula works for.


When we create or update a sales document, the system can use the customer ID, partner function, and external partner ID in the inbound EDI message to determine the internal partner number based on the setting in the configuration activity Convert External to Internal Partner Number. 

However, we need a more flexible way to determine internal partner number, so we involve CPF to implement it.

By using CPF, we are able to build up decision table and define criteria to determine internal partner number.

To configure the decision table, perform the activity Define Formulas for Internal Partner Numbers. 

For S4/HANA On-Premise user, follow the path: Sales and Distribution–>Electronic Data Interchange–>EDI Messages–>SOAP Services–>Configurable Parameters and Formulas in SOAP Services–>Internal Partner Number-->Define Formulas for Internal Partner Number

For S4/HANA Cloud user, search for the configuration activity Define Formulas for Internal Partner Number in your configuration environment.


How to Implement?

Perform the Define Formulas for Internal Partner Number configuration activity.

Define Formulas For Internal Partner Number

  1. Define Formula (Note: Make sure you select the checkbox “Active” if you want to enable this formula)

  2. Assign Formula Parameters

    Data Source Parameter

    The fields above are input parameters. Here we pick COMPANY_CODE and PARTNER_FUNCTION for demo.

    Which parameter you pick depends on your own determine rule.

    INTERNAL_PARTNER is the result parameter which is assigned automatically.

  3. Formula Tasks (Note: It’s predelivered. You do not need to change anything here)

  4. Assign Parameter Priority (Note: Only parameters which are added in step 2 can be chosen here)
    (Choose the parameters from the value help and assign each of them a priority)

  5. Define Decision TableNote: the order of the parameters in the decision table depends on the priority you maintained in Step 4.

    Decision Table Logic

    You create a decision table row base on your determination rule. Each row represents a rule that you leverage to determine internal partner number.

    Fields in grey background are input parameters, in green are result parameters.

    Through the input parameters, the system compares the value of the fields in EDI inbound to the values you have maintained in the decision table. For each parameter, you can specify an operator as follows:

    • Operator = (Equal to)

      If this operator is set, the system considers the corresponding parameter value meets the value provided by fields in EDI inbound. If every parameter in a row meets, the rule represented by the row is applied and the values in the result parameter are determined for the sales order or returns order to be created or updated.

    • No Operator (Do not consider)

      If the operator cell is left empty (‘blank/space’), the corresponding parameter is ignored during the determination.


    In order to achieve the final order, the system sorts the rows as below:

    1. First, the rows are sorted according to the parameter with the highest priority (that is, the parameter in the left-most column). Rows in which a specific value (as opposed to a wildcard) is filled for this parameter rise to the top.

    2. After this initial sort, the same principle is applied for the parameter with the second highest priority (second column from the left) to establish the relative order of the rows within the overarching order established by the previous sort.

    3. This process is repeated for each subsequent parameter to establish the final order of the rows, which ultimately dictates the sequence in which the system processes the rules that you have specified.

    The system then sequentially processes the rules by comparing the supplied input parameters against the conditions defined in the rules, starting with the first row and ending with the first meet. If there is no meet, processing ends at the last row without any rule being applied.

    For more information on how to create the formula, please refer to configuration help in the Define Formulas for Internal Partner Number activity, or check the product assistance here.


    Decision Table

    Create a sales order with the combination of company code 1010, customer ID 10100001

    Ship-to Party is determined and adopted.


Customers can configure their own determination rules using the Flexible Determination of Internal Partner Number accordingly to their needs. If everything is configured correctly, when you try to create/update a sales order, the system now calls the assigned CPF formula to determine the internal partner number.