Skip to Content
Product Information
Author's profile photo Hima Paluri

SAP S/4HANA Cloud Validation and Substitution rules

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”

Picture1.png

Click on “Create Rule”.

Picture2.png

Enter the following:

Context: Coding Block

Event: Coding Block

Rule Type: Validation Rule

Click on “Create”

Picture3.png

Under General Information enter the following:

Picture4.png

Under Precondition, enter the following:

Picture5.png

Under Validation, enter the following:

picture6.png

Click on “Save”.

Click on “Activate”.

picture7.png

2. Post Journal Entry

Login with the role General Leder Accountant: GL_ACCOUNTANT

picture8.png

Enter the following Header details.

picture9.png

Line Item 1: Enter the following details

picture10.png

Line Item 2: Enter the following details

picture11.png

Click on “Post”.

You should receive the below error message.

picture12.png

Click on OK and go to Line Item 1.

Change the Cost Center to CC_CON

picture13.png

Click on “Post”

picture14.png

3. Create Substitution Rule

Login with the role Configuration Expert – BPC_EXPERT

Go to “Manage Substitution/Validation Rules”

picture15.png

Click on “Create Rule”

picture16.png

Enter the following

Context: Coding Block

Event: Coding Block

Rule Type: Substitution Rule

Click on “Create”

picture17.png

Under General Information, enter the following:

picture18.png

Under Precondition, Enter the following:

picture19.png

Under Substitution, Enter the following:

Substitute Type: Substitute with Constant

picture20.png

Click on Save.

Click on Activate.

picture21.png

4. Post Journal Entry

Login with the role General Ledger Accountant: GL_ACCOUNTANT

picture22.png

Enter the following Header details.

picture23.png

Line Item 1: Enter the following details

picture24.png

Line Item 2: Enter the following details

picture25.png

Click on Post.

Click on Display.

picture26.png

Click on Settings

picture27.png

Select Functional area and click on OK.

picture28.png

picture29.png

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.

Please find help link for the feature: https://help.sap.com/viewer/0fa84c9d9c634132b7c4abb9ffdd8f06/2005.500/en-US/5c8c2825535f4e3aa9b7f716a0085221.html

Thanks & regrads,

Hima.

Assigned tags

      24 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Nadja Medeiros
      Nadja Medeiros

      Thanks for sharing Hilma!

      Author's profile photo Hima Paluri
      Hima Paluri
      Blog Post Author

      Thank you Medeiros.

      Author's profile photo Owen Liu
      Owen Liu

      Great content. Thanks for sharing.

      Author's profile photo Hima Paluri
      Hima Paluri
      Blog Post Author

      Thank you Liu.

      Author's profile photo Bhaskar Dey
      Bhaskar Dey

      I am seeing the overwrite option is disabled in the partner system for cost center. How can I enable the overwrite function for cost center ?

      Author's profile photo Ana Moreira
      Ana Moreira

      Very useful Hima. Thanks

      Author's profile photo Hima Paluri
      Hima Paluri
      Blog Post Author

      Thank you Moreira.

      Author's profile photo Sandeep Kumar
      Sandeep Kumar

      Hima Paluri very informative, thanks for sharing.

      Author's profile photo Hima Paluri
      Hima Paluri
      Blog Post Author

      Thank you Sandeep.

      Author's profile photo Vijayendra Tiwari
      Vijayendra Tiwari

      Thanks for sharing!

      Author's profile photo Hima Paluri
      Hima Paluri
      Blog Post Author

      Thank you Vijayendra.

      Author's profile photo Liling Jia
      Liling Jia

      thanks for sharing. there is customer asking about similar feature and i would like to refer this blog to them.

      Author's profile photo Hima Paluri
      Hima Paluri
      Blog Post Author

      Sure, that's great to know..

      Author's profile photo Norbert Birtalan
      Norbert Birtalan

      It is really useful, also easy to follow. thanks

      Author's profile photo Hima Paluri
      Hima Paluri
      Blog Post Author

      Thanks Birtalan..

      Author's profile photo Grace Zou
      Grace Zou

      Hi Hima, thanks for the post! Would you mind adding the help link for the feature: https://help.sap.com/viewer/0fa84c9d9c634132b7c4abb9ffdd8f06/2005.500/en-US/5c8c2825535f4e3aa9b7f716a0085221.html. I am the docu author and want to promote the help and collect feedback. Thanks!

      Author's profile photo Hima Paluri
      Hima Paluri
      Blog Post Author

      Hi Grace,

      Thanks for that, i have added the link now..

      Author's profile photo Anshu Dixit
      Anshu Dixit

      Great post 🙂

      Author's profile photo Hima Paluri
      Hima Paluri
      Blog Post Author

      Thanks Anshu..

      Author's profile photo Former Member
      Former Member

      Hi Hima,

      Great post.

      I'm trying to create a Validation rule slightly more complex (screenshot attached):

      For a certain GL account, we would like to enable a profit center OR a range of WBS

      The "or" is key here, it would be either one or the other depending of the scenario.

      Currently it looks like if I add a line in the Validation rule, the system takes it as a additional condition. "AND". It wont allow me to post my transaction if both condition are not met.

      I was wondering if one of you was able to setup a similar Validation rule already ?

      Same problem when trying to create a validation rule when for a specific GL account, we would like to enable a Cost Center OR a range of WBS.

      Best regards,

      Laurent

      Author's profile photo Sandra Herden
      Sandra Herden

      Hello Laurent,

      Currently the rule maintenance doesn’t provide the option of multiple validations connected by an OR. Though there is a work around by creating two instead of one rule.

      What you are trying to achieve:

      Precondition:

      GL_Accounting EQ 63010300

      Validation:

      Profit Center BETWEEN [abc] and [def] OR

      WB EQ 503040

      Instead you can create two rule as follows:

      Rule 1:

      Precondition:

      GL_Accounting EQ 63010300

      WB NOT EQ 503040

      Validation:

      Profit Center IN [abc]

      Rule 2:

      Precondition

      GL_Accounting EQ 63010300

      Profit Center NOT IN [abc]

      Validation:

      WB EQ 503040

      This is a little more work, but would serve the same purpose. I’d be happy to get to know in case this suggestion doesn’t work for you.

      Regards,

      Sandra.

      Author's profile photo Marcin Nowacki
      Marcin Nowacki

      Thank you!

      Author's profile photo Yang Wang
      Yang Wang

      Thanks for sharing Hilma! It is really helpful.

      Author's profile photo Thorina Wolf
      Thorina Wolf

      Great explanation! Thank you very much!

      It would be great if we could use custom fields and CDS views in the substitution. E.g. I want to put the employee service cost level in a custom field on the entry item.