Skip to main content

Opportunity Pricing

Introduction

WARNING: You must have edit access to any field that is configured as an output field for SAP Pricing. See the Troubleshooting section for more details. For example, if you wish to configure the Discount field as a pricing condition and it's configured as an output field, then users who want to perform SAP Pricing on an opportunity need to have edit access to the Discount field.

SAP Pricing inquiries use SAP pricing simulation to provide real-time pricing calculation of Salesforce opportunities. In addition to providing basic pricing information and material availability, pricing can be supplemented by providing pricing conditions to SAP® with data from Opportunity and Product information.

Caveats of Working with SAP Integration into Salesforce

  • By default, Salesforce calculates prices to two decimal places, while SAP calculates prices to multiple decimal places; you'll particularly notice this when applying discounts. This usually is noticeable only in fairly large monetary amounts, but this may cause your accounting department some consternation. In order to ensure that the pricing in Salesforce is identical to that in SAP, follow the directions listed in Enable 'More Decimals on Price' (https://help.salesforce.com/articleView?id=000213422&type=1).
  • Standard per-item prices sent back by SAP include freight. If you wish for your Salesforce quotes to exclude shipping at the item level, you need to configure and map a separate SAP field that sends back the appropriate value.
  • When mapping a percent discount from Salesforce to SAP, use a Salesforce percent type field.
  • Opportunity pricing does not support pricing of sales BOMs at the component child item - only the parent item.
  • Similarly, child items of exploded BOMs are not created/added to the Opportunity as Products.

Opportunity Pricing Setup

First, you must complete the steps described in the items listed here:

WARNING: If you haven't completed these steps, Opportunity Pricing will not be able to leverage SAP.

The enosix Opportunity Pricing feature ships with certain metadata pre-configured to jump-start your configuration process. We'll go over a few of those metadata types here.

Opportunity Pricing Custom Metadata

To access the Opportunity Pricing metadata setup:

  • Navigate to Setup.
  • Use the Setup Quick Find box to search for "Custom Metadata", then click the Custom Metadata Types link.

Custom Metadata Types Screen

These are the Custom Metadata Types specific to Opportunity Pricing:

SAP Pricing

SAP Pricing controls the default behaviors for the Opportunity Pricing framework.

  • Click the Edit link to the left of the Default record.

SAP Pricing fields:

  • Missing Mapping Behavior - This field determines how your organization wishes to process Salesforce Products that are not linked to SAP Materials. Select one of the following items from the drop-down list:
    • Price - Run the opportunity pricing through SAP, whether the products are linked or not.
    • Warn - Display a warning that some of the items aren't mapped, but allow opportunity pricing anyway.
    • Error - If any products are not linked to an SAP material, the user will receive an error and not be able to proceed further with SAP Pricing.
  • Order Type - By default, the pricing simulation is run against the "QT" SAP document type. If you wish to use a different document type, enter it here.
  • Label - The label for the record.
  • SAP Pricing Name - The unique name used by the Salesforce API.
  • Protected Component - If a developer releases protected custom metadata records in a managed package, checking this checkbox limits access to them in specific ways.
  • Namespace Prefix - The namespace prefix used for this value.

SAP Material Setting

The SAP Material Setting defines which sObject and field to use for saving the SAP Material Number.

  • Click the Edit link to the left of the Settings record.

SAP Material Setting fields:

  • Label - Label for the record.
  • SAP Material Setting Name - The unique name used by the Salesforce API.
  • Entity - Select which Salesforce sObject has the field you'll use to hold the SAP Material Number.
  • Material Number Field - Select the field of the sObject (defined in the Entity field) that will be used to hold the SAP Material Number.
  • Protected Component - If a developer releases protected custom metadata records in a managed package, checking this checkbox limits access to them in specific ways.
  • Namespace Prefix - The namespace prefix used for this value.

SAP Pricing Field Definition

The SAP Pricing Field Definition describes the attributes of an SAP Pricing Field record.

  • Click the Edit link to the left of the Plant record.

SAP Pricing Field Definition fields:

  • Label - The label for the record.
  • SAP Pricing Field Definition Name - The unique name used by the Salesforce API.
  • Field Object - This field determines whether the field being mapped is at the header or item level (as defined in the SAP document type). The drop-down choices are: Header and Item.
  • Field Name - For stock SBOs, this should be the Friendly Field Name.
  • Description - You can provide a brief description to go with the Field Name.
  • Can Input - Check this checkbox if you want the SAP Pricing Field to be used for input values or conditions.
  • Can Output - Check this checkbox if you want the SAP Pricing Field to be used for output values or conditions.
  • Protected Component - If a developer releases protected custom metadata records in a managed package, checking this checkbox limits access to them in specific ways.
  • Namespace Prefix - The namespace prefix used for this value.

SAP Pricing Field Definitions

Here is a list of all SAP Pricing Field Definitions that should exist (you must configure each field appropriately):

  • Distribution Channel
  • Division
  • First Date With Confirmed Quantity
  • Last Date With Confirmed Quantity
  • Material
  • Net Item Price
  • Order Quantity
  • Plant (as shown above)
  • Sales Organization
  • Sold To Party

SAP Pricing Field

The SAP Pricing Field records define the mapping between SAP fields and Salesforce sObject fields.

NOTE: Default records are generally named for the SAP fields being mapped.

  • Click the Edit link to the left of any record.

SAP Pricing Field fields:

  • SAP Pricing - This is a lookup field that points to the SAP Pricing metadata described above.
  • Label - The label for the record.
  • SAP Pricing Field Name - The field on the sObject selected above that will be mapped to the selected SAP field.
  • SAP Pricing Field Definition - This is a lookup field for the SAP Pricing Field type described above.
  • Salesforce Object - Select the sObject parent to the field that will be mapped.
  • Salesforce Field - Select the field on the sObject that holds the pricing field value.
  • Value - If this field is populated for a value, it will override anything that is entered at the sObject field level.
  • SAP Input - Check this checkbox to designate SAP Pricing Field as a value that's passed into SAP.
  • SAP Output - Check this checkbox to designate the SAP Pricing Field as a value that's returned from SAP.
  • Protected Component - If a developer releases protected custom metadata records in a managed package, checking this checkbox limits access to them in specific ways.
  • Namespace Prefix - The namespace prefix used for this value.

SAP Pricing Fields

Here is a list of all SAP Pricing Fields that should exist (you must configure each field appropriately):

  • Item Price
  • Product Quantity
  • SAP Material Number
  • Schedule Date
  • Save SAP Distribution Channel
  • Save SAP Division
  • Save SAP Sales Org

SAP Material Search Mapping

The SAP Material Search Mapping records identify which SAP Material fields will be used to search for SAP Materials for the Material Link process.

  • Click the Edit link to the left of any record.

SAP Material Search Mapping fields:

  • Label - The label for the record.
  • SAP Material Search Mapping Name - The unique name used by the Salesforce API.
  • SAP Material Setting - This is a lookup field that refers to SAP Material Setting described above.
  • SAP Field - Select the field that will be used in the SAP search criteria.
  • Entity - Select the sObject associated with the field that will be auto-populated for the search.
  • Product2 Field - Select the field that will auto-populate the search.
  • Visible - Check this field if you want this search field to be visible to users.
  • Editable - Check this checkbox if the search field must be an exact match. Otherwise, users can edit the search criteria to have a more flexible search.
  • Protected Component - If a developer releases protected custom metadata records in a managed package, checking this checkbox limits access to them in specific ways.
  • Namespace Prefix - The namespace prefix used for this value.

Material Search Mappings

Here is a list of all SAP Material Search Mappings that should exist (you must configure each field appropriately):

  • Material Description
  • Material Group
  • Material Type

SAP Pricing Condition

The SAP Pricing Condition defines conditions that are recognized by SAP to denote discounts, upcharges, taxes, freight fees, etc.

  • Click Edit if the record already exists. Otherwise, click New to add Opp Product Discount.

SAP Pricing Condition fields:

  • Label - The label for the record.
  • SAP Pricing Condition Name - The unique name used by the Salesforce API.
  • SAP Condition Type - This field determines whether the condition is included at the header or per-item level. The drop-down choices are: Header and Item.
  • SAP Pricing - The lookup field that points to the SAP Pricing metadata described above.
  • SAP Condition Code - The value to be passed into SAP .
  • Input Condition - Check this checkbox if the value is to be passed into SAP.
  • Output Condition - Check this checkbox if the value is to be returned from SAP and utilized in Salesforce.
  • Salesforce Object - Select the sObject related to the field that will store the value of this condition.
  • Salesforce Field - Select the field used to store condition value.
  • Protected Component - If a developer releases protected custom metadata records in a managed package, checking this checkbox limits access to them in specific ways.
  • Namespace Prefix - The namespace prefix used for this value.

SAP Pricing Condition Field

The SAP Pricing Condition Field records are related to an SAP Pricing Condition, indicating which condition field value to return.

  • Click Edit if the record already exists. Otherwise, click New to add Discount Rate and Discount Rate Unit.

SAP Pricing Condition Field fields:

  • Label - The label for the record.
  • SAP Pricing Condition Field Name - The unique name used by the Salesforce API.
  • SAP Field - Determines which of the condition fields to apply the condition value to or return value from. The drop-down choices are: Condition Unit, Condition Value, Rate, and Rate Unit.
  • SAP Pricing Condition - This lookup field references the SAP Pricing Condition described above.
  • Value - If this field is populated, it will override anything mapped at runtime.
  • Salesforce Object - Select the sObject related to the field that the value will be stored in.
  • Salesforce Field - Select the sObject field that will hold the value.
  • Input - Check this checkbox if the value is to be passed into SAP.
  • Output - Check this checkbox if the value is to be returned from SAP and utilized in Salesforce.
  • Protected Component - If a developer releases protected custom metadata records in a managed package, checking this checkbox limits access to them in specific ways.
  • Namespace Prefix - The namespace prefix used for this value.

Saving your Sales Area Values for Pricing

When the Sales Area is selected, it's possible to save that value to the opportunity in order to enable automated pricing with the Invokable Method that can be accessed via Process Builder.

To do this:

  • Navigate to Setup's Object Manager and click the Opportunity sObject link in the object list.

  • Click Fields and Relationships, then click New.

  • Follow the prompts to create three new text fields and label them for:

    • SAP Sales Org
    • SAP Division
    • SAP Distribution Channel

    TIP: Use Salesforce's Work with Standard and Custom Fields trailhead to learn about creating custom fields.

Create a New Pricing Field

  • Navigate to Setup.
  • Use the Setup Quick Find box to search for "Custom Metadata", then click the Custom Metadata Types link.
  • Click the Manage Records link (in the Custom Metadata Types Screen) to the left of the SAP Pricing Field metadata type**.**

  • Click New.

Map the Opportunity Fields

  • Map each Opportunity field you created for your Sales Area settings to their counterparts in SAP NOTE: Mark them as Input.
    1. SAP Sales Org
    2. SAP Division
    3. SAP Distribution Channel

  • You may populate these fields manually in the Opportunity or they can be saved the first time you go through SAP Pricing for that opportunity.

Linking Salesforce Products to SAP Materials

  • Open the App Launcher, and select Products.
  • Select the product you wish to link to an SAP Material.
  • In the Highlights panel, click SAP Material Link. NOTE: If the SAP Material Link option is not in the drop-down, you must add the custom button to the Product object page layout.

  • When you find the material you're looking for, click the Link button next to it. NOTE: If you don't see the SAP Material you wish to link with, edit any of the existing fields and click Search for Matching Materials.

  • On the Link Confirmation page, click the Link button.

  • Repeat all steps of this process for each product that you want to link.

Retrieving SAP Pricing for an Opportunity

  • Navigate to an existing Opportunity (the Opportunity should have Products that are linked to SAP Materials associated to it) that you wish to retrieve SAP pricing for.
  • In the Highlights panel, click the SAP Pricing button. NOTE: If the SAP Pricing button is not listed, you'll need to add the Mobile and Lightning Action to the Lightning Actions of the Opportunity page layout.

Select the Sales Area

  • Select the sales area (sales org, distribution channel, and division) to be used for the pricing simulation in SAP. NOTE: Skip this step if the sales area has been selected previously, since your selection may already be saved and you'll be prompted with a screen for confirming your selection.

Confirm Your Selection

  • Click the Yes-Confirm and Get Pricing button to confirm the sales area that you selected. NOTE: If you want to select a different sales area than the one that's displayed, click No - Go Back and Select Another and you should see a list of sales areas to select.

Complete the Process

  • If the entire configuration is set up correctly, your pricing should be complete with no errors.
  • Click the Exit button.

Verify that Opportunity Pricing works Properly

  • Confirm that the pricing has been updated for each Product associated to the Opportunity and that the total price of all products is displayed in the header area of the Opportunity.

Troubleshooting

When a field is mapped in metadata for SAP Pricing as an output field, and a user does not have edit access to that field (such as the Discount field), you may see errors similar to the following screenshot:

In order to resolve these errors, ensure that all users are granted edit access to all fields that are configured as output fields for SAP Pricing.

When all permissions are set correctly, you should see the following screen when you run SAP Pricing: