SAP Knowledge Base Article - Public

3709819 - How to implement OR operator in Manage Substitution/Validation Rules in SAP S/4HANA Cloud Public Edition

Symptom

Unable to implement the "OR" operator for the custom class in Manage Substitution and Validation Rules in SAP S/4HANA Cloud Public Edition.

"Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental."

Environment

SAP S/4HANA Cloud Public Edition

Reproducing the Issue

  1. Open "Manage Substitution and Validation Rules" application.
  2. Create a new Substitution/Validation rule
  3. Attempt to configure the Precondition rule with an OR operator.
  4. Observe that the "OR" logic is not applied as expected.

Cause

The logic of the "OR" operator and "AND" operator is triggered as follows:

All lines of conditions are implicitly connected by a logical AND.

However, unless the left column (Field/Function) of several EQUAL comparisons is identical. In this case these lines are connected by an OR.

Resolution

Ensure that the Field/Function in the left column is identical.

For example: 

Choose "Show Script", the OR operator is triggered as CompanyCode field left column is identical, while other fields like Company Code Currency, and Fiscal are connected by the "AND".

The function in the left column of Precondition must also have the same parameters and values to trigger the "OR" operator.

Choose "Show Script" to confirm the logic.  

Keywords

substitution rule, OR condition, custom class, journal entry item , SAP S/4HANA Cloud Public Edition, validation rule, substitution logic, logical AND, logical OR, field value settings, SAP standard design, substitution issue, "Manage Substitution / Validation", "Manage Substitution/Validation Rules" , KBA , FI-SL-VSR-2CL , Validation, Substitution and Rules (Public Cloud) , How To

Product

SAP S/4HANA Cloud Public Edition all versions

Attachments

Pasted image.png