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.
cancel
Showing results for 
Search instead for 
Did you mean: 
4,417

Introduction


Hi everyone, I am a Sales consultant for SAP S/4HANA Cloud, public edition. I would like to introduce one of the useful new features of 2308.

As of 2302, profit centers should be derived from Material master with a key combination of Material code and Plant code. However, required profit center structures may be often complex and derivation from Material master could not cover business requirements. From the 2308, you can derive profit centers with various key fields, such as product groups, customer groups, sales regions, or distribution channels with using the app Manage Substitution / Validation Rules - Journal Entries. Additionally, this implementation is possible without ABAP coding.

Prerequisite


Before you implement the Profit Center Derivation, you need to check the profit center determination access sequence described in the following link for the Help Portal page:
Profit Center Determination in Sales Documents

Example of Business Requirement


A customer defines profit centers for different geographical areas belonging to different segments.. Therefore, profit centers can be derived in accordance with Sales Districts.in sales orders.

































Segment Profit center Sales district Description
1000_A ZKSW_A001 JP0001 Northern Japan
JP0004 Eastern Japan
JP0005 Middle Japan
1000_B ZKSW_B001 JP0002 Southern Japan
JP0003 Western Japan

Steps to set up Profit Center Derivation



  1. Access the app Manage Substitution / Validation Rules - Journal Entries with the role SAP_BR_BPC_EXPERT.

  2. Click on "Create Rule" then pop-up appears

  3. Select "Profit Center Derivation in Sales Documents" for the field Business Context

  4. The field Event is automatically fulfilled with "Sell from Stock and Advanced Intercompany Sales". Otherwise, you need to select the event.

  5. Close the pop-up with clicking on "Create" .

  6. New Substitution area appears. Fulfill Rule Name and Description

  7. Set up Precondition.- refer to the section Setting up Substitution: Alternative 1 & 2

  8. Set up Substitution.- refer to the section Setting up Substitution: Alternative 1 & 2

  9. Click on "Save"

  10. Click on "Activate"


The app is commonly used in Sales Accounting. For further information refer to the following Help Portal link:
Manage Substitution/Validation Rules

Setting up Substitution: Alternative 1


In order to realize the example of business requirement, simpler way is this alternative 1 which creates the logic for profit center determination on the app. However, it has lower flexibility. If you usually use derivation from material master and you have some specific case you need to overwrite a profit center derived from material master. This could be nice option.

Precondition


You can use any field in the CDS view: I_SLSDOCPROFITCENTERDERIVATION for the Field/Function. Additionally you can use functions such as CONCATENATE(), SUBSTRING() and getWBSInternalId() which is the function to map WBS external ID to WBS internal ID. You have many choices for the Operator such as Equal To, Greater Than, Between and etc,.

In this example, "SalesDistrict" should be selected for the Field/Function and simply set fixed value of Sales District for the Value connected with the Operator "Equal To" as shown on the screenshot below.



Substitution


You can only select ProfitCenter for the Target Field and other fields are not shown in the selection screen.
Available Substitution Types are following:
Clear Value
Substitution with Constant
Substitution with Field / Function
Table Lookup
In order to realize the case of example, choose "Substitution with Constant" and fulfill Source with target value of profit center.

The checkbox Overwrite should be checked if you have a profit center derived from material master.

This is like IF...ENDIF statement in ABAP but we cannot define ELSE here. Therefore, you have to define Substitutions for each target profit center code.
In this example, you need to define one more Substitution shown on the following screenshot.



Setting up Substitution: Alternative 2


More flexible way is to define a custom table with using app Custom Business Objects and to lookup the record to be matched from the table.
For example, a custom table with the fields Sales District and Profit Center is defined as shown below.For further information regarding the app Custom Business Objects, refer to the link for the Help Portal page:
Creating Custom Business Objects


Entries on the custom table YY1_PROFITCENTERDERIVATION are shown below:



Precondition


Set Field/Function:to SalesDistrict. Set Operator to "Equal To Table Lookup" . Click on the field Value. Following Pop-up screen appears. Select created custom table ID on the field Select from Data Source.
Select a field of the custom table for the field Source Field, for example, YY1_SALESDISTRICT.
Select Equal to Field/Function for the field Operator.
Select a field of the CDS view I_SLSDOCPROFITCENTERDERIVATION, for example, I_SLSDOCPROFITCENTERDERIVATION-SalesDistrict.
Close the pop-up with clicking on Save



Substitution


Set the Target Field to ProfitCenter.
Set the Operator to Table Lookup.
Click on the field Value, Pop-up Appears as shown below: Select created custom table ID on the field Select from Data Source.
Select a field of the custom table for the field Source Field, for example, YY1_PROFITCENTER.
Select Equal to Field/Function for the field Operator.
Select a field of the CDS view I_SLSDOCPROFITCENTERDERIVATION, for example, I_SLSDOCPROFITCENTERDERIVATION-SalesDistrict.
Close the pop-up with clicking on Save


When you return to the main screen, you need to check the checkbox: Overwrite, if you want to overwrite the profit center input from other method.
Click on Save.

Click on Activate. Now the substitution is ready.



Testing


After the activation of the substitute, the following steps were tested.
1. Profit center is derived from material master when Sales District on the line item is blank.

2. When Sales District is set to JP0001, Profit Center ZKSW_A001 is derived from the substitution.

3. When Sales District is set to JP0002, Profit Center ZKSW_B001 is derived from the substitution.

*I tested a sales order creation with Alternative 2. The behaviour with Alternative 1 should be the same.


 

Conclusion


This substitution enables SAP customers to be more flexible in defining profit centers and defining plants.

I hope you find this blog helpful.

I also appreciate your questions and your feedback.

 
2 Comments