SAP Sales Cloud

Extension Fields – Enabling Calculations on the fly – SAP C4C

For this blog post we will consider an example for Quotes, where I will create an Extension field which will calculate an amount value on the fly.

Scenario: As part of requirement, the standard external Price field will be used as Item price. Another price field should be available which will be manually entered by the user creating the object. This New amount field will capture the selling price of the Item, and another amount field should capture the total selling price.

The new field will be a standard extension field with no calculation involved. But, to capture the total selling price, an extended field will be created which will calculate the total selling price value on the fly when the user enters the Selling price of the item.

Step 1: Once on the Sales Quote overview screen, click on the option Start Adaptation from the User icon.

Step 2: Click on the Tab Products and click on the blue pencil icon to create an extension field at item level.

Step 3: click on the option Add -> Field to create an extension field.

Step 4: Click on Create Fields option in the pop-up and create a calculated field by selecting the tag option.

Step 5: A calculated Field can be of the following Data types:

Out of these Data types, we will now observe the creation of Amount Data type field.

All the mandatory fields are populated as shown below:

Note: Under Calculation Rule, we should make sure that we select the correct operator.

The available operators are:

In our scenario, we will take Multiply as the operator, as we must calculate the total selling price of the item. We achieve this by the calculation:

Request price Sales = Request Price * Request Quantity

Step 6: Once we click on Save and Close, the field will be created and will be displayed in the list of fields.

Select the Check box and Click on Apply on the same screen. This will enable the field to be displayed on the Item. Now for every value entered for the field Requested price, the field Requested Price Sales will calculate the total value on the fly and no manual effort is required.

Let us also understand other scenarios in which this functionality can be beneficial:

Scenario 1: In continuation with the above scenario, if business would like to compare the Target Price Sales to that of the Requested Price Sales, i.e. total Cost price to total selling price of product, in this scenario, the current functionality will be beneficial. Where we can create an Extension field which will save the value of Total selling Price/Total Cost price, and one calculation field which will save the percentage value of the same. We will use workflow to populate the value of the 1st Extension field. Once the 1st field is populated with the value, the calculated extension field will calculate the %value on the fly. the configuration for the Calculated extension field would be as below:

As you observe we have considered Data type as Decimal number and under the calculation Rule, one is a field value, which will determine the numeric value of Total Selling price/total cost price, and the other field is a Constant which will help in calculating the % value. When we Select Constant, we can provide a specific numeric value which will be used as part of the calculation to determine the value of the field.

Note: Though the value calculated is a % value, but it will not be denoted in the value field. The field name should represent the % symbol, to determined that, the value is a percentage value and not numeric.

Scenario 2: If business wants to have a text field which is auto populated to determine Product Category description and Selling company on each item of the Quote, this scenario can be accomplished with the calculated extension field.

In this scenario, a calculated Text (data type) field will be created, which will capture the Product Category Description field text followed by the selling company of the item. This field will auto-populate the text value of the field when the Product category description (auto determined by standard for each item when product is selected) and selling company fields is filled manually. The extension field creation screen would be as below:

Select the field created and click on Apply to populate the field on the quote.

Once it is selected, the field will be displayed in the item level of the quote. And once the item is added and the selling company is maintained, the extension calculated text field will auto determine the text value even before Save.

Note: For any scenario, the changes will take effect, only when the user exits the adaptation mode.

Few instructions to consider while creating a calculated field:

  1. A Text field can either be of 40, 80, 120 characters or an extended text.
  2. For any Data type of calculated extension field, only two fields can be used as part of calculation.
  3. The calculation can be done between two field values or one field and one constant value.
  4. If a calculation must be performed for more than two field a workflow can be used to display the final value in a general KUT extension field.
  5. Best practice is to add a prefix ‘Z’ to the Technical field during extension field creation, which will help in clear differentiation between an extension field and a standard field.
  6. Calculated extension field cannot have default values, as they will represent the value determined by calculation.

These were few scenarios I wanted to share as part of my experience with business users. There still can be many more scenarios where this functionality can be implemented, and with new quarterly enhancements from SAP, sky is the limit.

We have observed that this functionality can be utilized in achieving multiple business needs in different ways, let us also understand what benefits this functionality can bring:

  1. No SDK (custom development) required to create such calculated extension fields.
  2. These field calculate the required value on the fly and does not require any manual intervention.
  3. Flexibility in choosing the exact data type, and selection of fields or Constants with the correct operators to achieve the accurate value on the fly
  4. Extending the extension fields to respective Data source which will help in building Reports around the objects.
  5. Options to either make the field visible/hidden/mandatory or Read only.
  6. These fields can also be sent to external systems by selecting the settings for services and OData.
Rating: 0 / 5 (0 votes)

Leave a Reply

Your email address will not be published. Required fields are marked *