Enterprise Resource Planning Blog Posts 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.
cancel
Showing results for 
Search instead for 
Did you mean: 
WesleyZhang
Product and Topic Expert
Product and Topic Expert
6,818

As we all know, pricing is really important when it comes to sales documents. In SAP S/4HANA Cloud, you can add custom fields to sales documents using key user extensibility. You can then use these custom fields like any other standard field in your pricing configuration. When you then change the value of these custom fields in a sales document, you can modify the price of a sales document. In this blog post, we show you how to create and use a custom field in pricing. Just follow the steps!

In our example, we create a new item field for a member status in sales orders. Depending on the member status (Gold, Silver, or Bronze), you can award your customers specific discounts.

1. Create a custom field in the Custom Fields app

First, create a custom field for sales documents (business context: Sales: Sales Document Item). In this example, we create the field ITEMMEMBERSTATUS.

WesleyZhang_0-1716867138159.png

Enable the usage of this field for Sales Document to Pricing Communication on Item Level on the Business Scenarios tab.

WesleyZhang_1-1716867160733.png

On the User Interfaces tab, enable the usage for the Manage Sales Orders – Version 2 app.

WesleyZhang_2-1716866226487.png

Publish your custom field. The custom field is created in two business contexts: Sales: Pricing Communication Item and Sales: Sales Document Item.

WesleyZhang_3-1716866247643.png

Open the custom field in the Sales: Pricing Communication Item business context. On the APIs tab, enable the usage of the field for Condition Record for Pricing in Sales.

WesleyZhang_4-1716866282263.png

On the User Interfaces tab, enable the usage of the field for Manage Prices – Sales and Manage Tax Rates – Sales. This allows you to maintain the prices in the Manage Prices – Sales app in step 8.

WesleyZhang_5-1716866296452.png

2. Add the custom field to the field catalog for pricing in sales

In your configuration environment, search for the Change Field Catalog for Pricing in Sales (ID: 103118) configuration activity. Use the value help to add the custom field to the field catalog.

WesleyZhang_6-1716866313779.png

3. Add the custom field to a condition table

Search for the Create Condition Tables for Pricing in Sales (ID: 103119) configuration activity. Create a condition table and add the custom field.

WesleyZhang_7-1716866335856.png

Note down the number of the generated condition table for the next steps. In this example, we create condition table 502.

4. Create an access sequence for the condition table

Search for the Set Access Sequences (ID: 103121) configuration activity. Create an access sequence for the condition table that you created in step 3. In this example, we create access sequence ZIMS.

WesleyZhang_8-1716866365990.png

WesleyZhang_0-1716866650712.png

 

WesleyZhang_1-1716866671604.png

 

WesleyZhang_2-1716866697837.png

5. Create a condition type for the access sequence

Search for the Set Condition Types for Pricing in Sales (ID: 101120) configuration activity. Create a condition type for the access sequence that you created in step 4. In this example, we create the condition type ZIMS.

WesleyZhang_3-1716866719984.png

6. Create a pricing procedure for the condition type

Search for the Set Pricing Procedures (ID: 101117) configuration activity. Create a pricing procedure for the condition type that you created in step 5.

WesleyZhang_4-1716866751717.png

 

WesleyZhang_5-1716866760544.png

 

WesleyZhang_6-1716866771597.png

7. Set the pricing procedure determination for the pricing procedure

Search for the Set Pricing Procedure Determination (ID: 101118) configuration activity. Set the pricing procedure determination for the pricing procedure that you created in step 6.

WesleyZhang_7-1716866808382.png

8. Create condition records for the condition type

Open the Manage Prices - Sales app. Create a condition record for condition type ZIMS.

WesleyZhang_8-1716866816861.png

9. Testing your configuration

Once you're done with your configuration, add the custom field to the UI the Manage Sales Orders – Version 2 app using UI Runtime adaptation. Then, select a value for this custom field on the UI and choose Update Prices

WesleyZhang_9-1716866838851.png

You have now added a custom field for pricing to a sales document!

If you want to automatically set the value of the custom field by reading from the customer master, for example, you can also use the BAdI Modification of Item Custom Fields in Sales Documents (SD_SLS_MODIFY_ITEM). You can find further information about how to use BAdIs in sales documents in this blog post.

Additional information:

Documentation for Custom Fields in Pricing
Key User Extensibility in SAP S/4HANA Cloud Sales

 

Was this blog post helpful for you? Please share your ideas and feedback, they are very much appreciated for future blog posts.

16 Comments
priya_sshekhar
Explorer
0 Kudos

Is this functionality available in On prem version?

CE6
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Priya,
In onPrem it works similar, but you need to do the configuration in SPRO. You can find the corresponding documentation here.
best regards,
Christian

priya_sshekhar
Explorer
0 Kudos

Hi Christian,

Thanks for your response.

After creating and enabling the fields in the Custom Fields App, where do we do the assignment of the transaction data like we used to do earlier .

Example : 

    FORM USEREXIT_PRICING_PREPARE_TKOMP.
    MOVE VBAP-PRODH(3) TO TKOMP-ZZPRODH.
    ENDFORM.
    Thanks,
    Priya

 

CE6
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Priya,
If you enable the business scenario Sales Document to Pricing Communication on Item Level for a custom field, the value of the custom field will automatically be copied from vbap-yy1_mytestfield_sdi to tkomp-yy1_mytestfield_pci.
There is no further coding or configuration needed.
best regards,
Christian

girishz13
Discoverer
0 Kudos

Hi Christian,

A very useful blog, one question though can we take this one step further to read the pricing attribute from master data sources such as the material master? I am trying to do this , but cant seem to have the same field linked for both purposes.

Thanks,

Sabari Girish 

 

CE6
Product and Topic Expert
Product and Topic Expert

Hi Sabari,
Yes, you can also set the pricing attribute from material master data. There is already a blog describing the scenario for customer master data. You can do it in a similar way with released CDS View I_PRODUCT and BAdI SD_SLS_MODIFY_ITEM.
If you set the custom field based on material master data with the above mentioned features, you can easily use that value in pricing following the steps in this blog.
best regard,
Christian

girishz13
Discoverer
0 Kudos

Thanks a lot Christian this helps.

kiran_kumar262
Explorer
0 Kudos

Hi @CE6 ,

Im my case we have extended only the Business Context: Sales: Pricing Communication Head (SD_PRICECOMHEAD) with required custom fields. 

Now to map the data for these custom fields in KOMK structure do we have any BADI available or we need to use the FORM USEREXIT_PRICING_PREPARE_TKOMK ?

As i have not extended the business scenario 'Sales Document to Pricing Communication on Item Level' how to map the data in KOMK structure? 

Thanks,

Kiran

 

CE6
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @kiran_kumar262,

In S/4HANA Public Cloud there is no USEREXIT_PRICING_PREPARE_TKOMK or similar BAdI available. Therefore it is recommended to fill the value of the custom field in sales document and pass it to pricing via the mentioned business scenario. Do you see any issue doing that?
If you want to set the field automatically in the sales document, you can use BAdIs SD_SLS_MODIFY_HEAD or SD_SLS_MODIFY_ITEM.

best regards,
Christian 

kiran_kumar262
Explorer
0 Kudos

@CE6 Thanks for the update. 

We are using On Prem 2023 version of S/4. 

As recommended, if we extend the sales document and then pass it to pricing via the mentioned business scenario, all the custom fields are created in both VBAK and VBAP tables, which we don't want as there is no further usage of these fields. 

 

USEREXIT_PRICING_PREPARE_TKOMK we still can use to map the data, but want to know is there any better way to pass the data to these fields?  

Thanks,

Kiran 

CE6
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @kiran_kumar262 ,
Thanks for the information. I understand your concerns, but currently there is no other possibility to fulfill the requirement. 

If you still want to have such a feature, you need to request it via Customer Influence Portal.

best regards,
Christian

Mertcan
Explorer
0 Kudos

Hello @WesleyZhang,

In our case we want to update prices automatically without pushing update price button. Is there a way to do that?

 

CE6
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @Mertcan,
Currently there is no option to update prices automatically. What is your exact requirement? In which cases to you want to update prices automatically?

There is already a similar feature request in SAP Customer Influence where you can vote for to give it more priority in planning.
https://influence.sap.com/sap/ino/#/idea/292742

best regards,
Christian

Dmitry_K
Explorer
0 Kudos

Hello,

how to automatically trigger price update after some important fields have been changed by user in sales order?

For example, our prices depend on plant. Assume user changes plant on sales order item - the price should be redetermined automatically, but its not happening.

CE6
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @Dmitry_K,
At the moment you cannot retrigger pricing automatically in S/4HANA Public Cloud. 
There is already a customer influence request for that requirement. Please vote for it and leave some comment to get the requirement prioritized.
https://influence.sap.com/sap/ino/#/idea/292742

best regards,
Christian

Dmitry_K
Explorer
0 Kudos

In BADI extension point SD_SLS_MODIFY_ITEM_BUSINESS its possible to change pricing date on item, which seems to be triggering price update (at least for most fields its seems).

So you can change it +1 and -1 day around header pricing date, or implement other logic. It means though that you cannot use item pricing date as intended, and pricing date can go into incorrect validity range.

Not perfect workaround, but better than nothing. It strange how this critical requirement was not thought about in very beginning.

Alternative would be to force users to always run full price update manually after any change, which is weird.