Why is Validation and Substitution rule important?
As the user sets the Validation rule, it checks the validation rule defined on specific fields data. When user is trying to post the transaction and enters data in that specific field, which violates the validation rule, system throws an error message for the user and it will not allow the transaction to post.
It will succeed to post the transaction only when the data is posted in that specific field as defined in the validation rule. It helps to avoid wrong entry at initial stage of posting the transaction.
Whereas Substitution rule is set up to substitute the data immediately upon the entry made. As the user enters the value, system validates according to the prerequisite defined by the user. If the prerequisite rule is met, the system replaces the value entered with other values.
With SAP S/4HANA Cloud 2005, The Manage Substitution/Validation Rules app for JVA is enhanced with the new comparison operator Matches and the new substitution type Table Lookup.
The Matches operator can be used to match a string-type field value against a regular expression.
The Table Lookup substitution type allows user to choose a source field from a custom business object and uses its value to fill in the target field.
Let’s see how it looks and how to configure in the Cloud System with 2005 upgrade:
Apps involved:
- Manage Substitution/Validation Rules
- Post General Journal Entries
Business Roles:
Unrestricted read/write for:
- Configuration Expert – Business Process Configuration: BR_BPC_EXPERT
- General Ledger Accountant: BR_GL_ACCOUNTANT
Example:
1. Define Validation Rule
Login with the role Configuration Expert – BPC_EXPERT
Go to “Manage Substitution/Validation Rules”
Click on “Create Rule”.
Enter the following:
Context: Coding Block
Event: Coding Block
Rule Type: Validation Rule
Click on “Create”
Under General Information enter the following:
Under Precondition, enter the following:
Under Validation, enter the following:
Click on “Save”.
Click on “Activate”.
2. Post Journal Entry
Login with the role General Leder Accountant: GL_ACCOUNTANT
Enter the following Header details.
Line Item 1: Enter the following details
Line Item 2: Enter the following details
Click on “Post”.
You should receive the below error message.
Click on OK and go to Line Item 1.
Change the Cost Center to CC_CON
Click on “Post”
3. Create Substitution Rule
Login with the role Configuration Expert – BPC_EXPERT
Go to “Manage Substitution/Validation Rules”
Click on “Create Rule”
Enter the following
Context: Coding Block
Event: Coding Block
Rule Type: Substitution Rule
Click on “Create”
Under General Information, enter the following:
Under Precondition, Enter the following:
Under Substitution, Enter the following:
Substitute Type: Substitute with Constant
Click on Save.
Click on Activate.
4. Post Journal Entry
Login with the role General Ledger Accountant: GL_ACCOUNTANT
Enter the following Header details.
Line Item 1: Enter the following details
Line Item 2: Enter the following details
Click on Post.
Click on Display.
Click on Settings
Select Functional area and click on OK.
Functional Area is YB20 which proves Substitution Rule has been triggered correctly.
With this the user can successfully create and validate the rules as per business requirements.