Analyzing Substitution Rules


After completing this lesson, you will be able to:

  • Discuss the substitution rule settings
  • Test substitutions on journal entries

Substitution Rules

Beyond using validation rules in daily operations, you are keen to explore additional features that guarantee the accuracy of account entries, particularly regarding account assignment objects. As a result, you seek to deepen your knowledge of how substitution rules are set, applied, and executed.

Application Area

Substitution rules are used to replace or derive values during data entry in runtime applications. For example, they can secure a posting, ensuring a specific assignment for specific costs. Substitution rules can also be used to complete a posting with additional assignments. In essence, they are useful whenever there's a need to automate and standardize data entry.

For instance, the profit center field in a sales order can be automatically filled in based on the sales organization used.

Consider a posting on the car insurance account below: You want to ensure that the cost center assigned remains consistently the same.

Initially, the substitution rule checks, through the precondition formula, if the entry is on G/L account 63004100. If it is not, the substitution rule does not affect the posting. However, if the entry is made on the Car Insurance account, the substitution is activated and populates the cost center field with the specified value C9999.


To configure a substitution rule, follow the steps highlighted in the figure and text below. You configure substitution rules in the Manage Validation/Substitution – Journal Entry app.

The substitution is split into three sections:

  1. General Information: Rule Name, Description
  2. Precondition: Conditions under which the substitution will occur (If left empty, the substitution is always applied).
  3. Substitution:
    • Target Field: Field to be substituted.
    • Substitution Type: Method of substituting values for the target field.
    • Source: Field that is determined by your substitution type

For certain target fields, you can choose whether you want to overwrite an existing value.

The substitution type provides the following options:

  • Substitution with a constant value that is explicitly defined in the rule.
  • Substitution with Field/Function that fills in or replaces the target field with the value from the source field (example: profit center filled in with the source profit center of a product) or with a function.
  • Substitution with a Table lookup that leverages custom business objects to fill in the target field (decision table). This is an advanced functionality that employs the Custom Business Objects app.

The overwrite feature is applicable only for some source objects (cost center is excluded).

If you have defined a substitution that contradicts a validation condition, the system informs you of this by displaying a message (coming from the validation rule). We can, therefore, say that validation has priority over a substitution.

Overall Benefits

Substitution rules in SAP S/4HANA provide a range of benefits:

  • Efficiency and consistency: It automates repetitive tasks and ensures data consistency, reducing manual errors with automatic population, thus enhancing operational efficiency.
  • Compliance and control: It aids in maintaining regulatory compliance and provides greater control over financial processes by setting predetermined rules for transactions.
  • Customization and flexibility: The rules can be tailored to match specific business requirements, providing flexibility and adaptability as business needs evolve.

Substitution rules can be transparent to the user, who can focus on other tasks.

Further Application Areas

Beyond improving data reliability in financial and management accounting, substitutions in SAP S/4HANA are also employed in various application areas. Here are a few illustrations:

  • Material Management: Update of fields like material group, valuation class, and so on based on certain conditions. For instance, a certain type of material always belongs to a specific material group.
  • Sales and Distribution: Fields like sales organization, distribution channel, shipping conditions, and so on. For example, for a specific customer, the systematic use of a specific shipping condition or of a specific discount.
  • When a business user uses the billing document type F1 to post data for the company code 1010, the rule fills in the Product Sold Group field with the value A001 and the Functional Area field with the value from the Functional Area field of the relevant WBS element.

Keep in mind, the primary aim of utilizing substitutions in SAP S/4HANA is to enrich the existing data fed into the system with additional details following preset rules, thus enhancing data accuracy, and providing supplementary reliable information.

How to Manage Substitution Rules

Log in to track your progress & complete quizzes