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.
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
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 |
The app is commonly used in Sales Accounting. For further information refer to the following Help Portal link:
Manage Substitution/Validation Rules
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.
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.
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.
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:
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
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.
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.
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.