Mapping the Pricing Response into Quote Columns

A pricing procedure combines different types of charges (such as the list price, freight, discounts and surcharges) into a single procedure, where the sub-totals and the totals comprising the net amount are defined. In other terms, a pricing procedure defines a group of condition types in a particular sequence.

When SAP CPQ is integrated with SAP Variant Configuration and Pricing, pricing procedures are defined in SAP ERP and, from there, via SAP Variant Configuration and Pricing, replicated into SAP CPQ (as long as Variant Pricing is selected for products obtained via knowledge base synchronization). It is possible to map pricing procedures into SAP CPQ via the fields described on the SAP General Attribute Mappings page. When a pricing procedure is mapped this way, the arriving response payload is stored in the SAP CPQ database, in the column pricingResponseJson of the table sys_VC_Item_Pricing. The pricing response payload contains information about the conditions from the pricing procedure.

Example: a pricing procedure with the name ZRt52t exists in SAP ERP, in which various condition types are defined. One of them is the condition type VA00 with the step number 10 and the condition value 40. The information about the condition type is stored in SAP CPQ as conditionType (VA00), conditionStep (10) and conditionValue (40).

By default, the List Price column in the quote displays the sum of the base price and the variant conditions from the pricing procedure. There are multiple ways pricing can be set up here:

  • SAP CPQ-specific discounts and surcharges can be added on top of the List Price. This is the out-of-the-box scenario.
    • SAP CPQ Quote Header Price Type → S4/HANA/SAP ERP Sales Order Header Price Condition
      • Additional Discount - Discount PercentRB00
      • Additional Discount - Discount AmountHA00
    • SAP CPQ Quote Item Price Type → S4/HANA/SAP ERP Sales Order Item Price Condition
      • List PricePR00
      • Rolled Up Discount PercentK007
  • A pricing procedure breakdown can be mapped into multiple columns and the existing conditions (discounts, surcharges and so on) can be edited.
  • A pricing procedure breakdown can be mapped into multiple columns, along with SAP CPQ-specific discounts and surcharges (which do not exist in the pricing procedure).


All the information from the pricing response from SAP Variant Configuration and Pricing is fully accessible through scripts. It is possible to make condition types from the pricing procedure visible and/or editable on the user interface of the quote. To do that, you need to use a script to map individual condition types to custom item columns.

Prerequisites

Complete the following prerequisites before mapping the pricing response into quote columns.

  1. Create a dedicated quote item custom field to which you want to map the condition type.
  2. To display the field on the quote, you need to add it to the quote XSLT, which is defined per user type.
  3. Assign a value to the quote item custom field’s key in the dictionary, to enter a name for the field.
  4. Add the field to the list of editable fields.

Procedure

  1. Go to Setup > Develop > Global Scripts > Add New.
  2. Write a script that will map the pricing response breakdown to quote item custom fields.
  3. Select an execution event for the script in the Events tab.
  4. Click Save.
    The value of the condition from the pricing response is now visible in the quote item custom field to which it was mapped via the script.

Here is an example script which can be used here:

for mainItem in Quote.MainItems:
    
    if not mainItem.ParentItemGuid:                                 #checks for the root item, to get the entire pricing response
        x = 0 
        y = 0
        for condition in mainItem.VCPricingPayload.Conditions:
            if condition.conditionType == 'PR00':                   #checks for the certain condition type (In this case: List price)
                x += condition.ConditionValue                       #sumarizing values of condition type PR00           
                
            else if condition.conditionType == 'VA00':
                y+= condition.ConditionValue
                
    mainItem["BasePrice"].Value = x                                 #assigns condition values to CPQ Quote Item Custom Field
    mainItem["PricingSurcharge_1"].Value = y
 

Making the Quote Item Custom Field Editable

There are additional requirements which you need to complete to make the quote item custom field editable:

  • Write a custom calculation for that field.
    Once a condition type is mapped to a quote item custom field, SAP Variant Configuration and Pricing no longer provides the pricing information, so a custom calculation must be used in order for any edits to apply.
  • Adapt the standard IFlow for the Place Order action in SAP Cloud Platform Integration by manually mapping condition types and their respective values exposed in SAP CPQ columns to the corresponding elements from SAP ERP. For example, the quote item custom field Surcharge 1 should be mapped to the corresponding condition from the SAP ERP pricing procedure ZRt52t.


More Information
You are here: SAP Sales Cloud CPQ Online HelpAdmin Page HelpIntegrationsIntegrations with SAP SolutionsVariant Configuration IntegrationMapping the Pricing Response into Quote Columns