SAP Knowledge Base Article - Public

3799569 - Validation Error occurs even when conditions are met in Journal Entry Validation - SAP S/4HANA Cloud Public Edition

Symptom

Validation error occurs even though the validation conditions are fulfilled. Validation rules involving at least two conditions for the same fields, with IS NOT INITIAL condition at the last position. For example:

  1. DocumentItemText Not Equal To Field/Function CompanyCode
  2. DocumentItemText Is Not Empty

"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. In App Substitution/Validation Rule - Journal Entry validation logic that checks a field “Is Not Empty” along with additional comparisons (for example, trading partner not equal to company code), which is connected by an AND/OR 
  2. Open app Post General Journal Entries.
  3. Enter a journal entry with
  4. Press Enter to validate.
  5. Observe that a validation error occurs although the field values satisfy the preconditions.

Cause

This is a known issue in backend code generation for validation rules: when a condition using “Is Not Empty” (NOT field IS INITIAL) is combined with one or more subsequent field comparisons using AND/OR, the generated code can contain contradictory checks (for example, both “field IS NOT INITIAL” and “field IS INITIAL”), leading to false validation failures. This happens when "NOT (... IS INITIAL)" (generated from "Is Not Empty") is not at the last position in the generated Script's conditions list.

Resolution

The fix for this problem is included in the continues feature delivery of S/4HANA Cloud Public Edition. According to the current plan, the fix will be available and imported into customer systems by the end of Calendar Week 45 (November 6th - 8th).

Meanwhile, a workaround is available with the below steps:

  1. Edit the affected Validation Rule and reorder the condition so that the generated NOT ( ... IS INITIAL) in generated Script appears at the last position. Example:
    • First: Field Is Not Empty
    • Then: Field Not Equal To Company Code (or other comparisons)
  2. Activate the Validation rule and test again in the posting app.
  3. If analysis is needed, enable logging in app Set Substitution/Validation Log for the relevant event and user, reproduce the issue, and review the Substitution/Validation Log.
  4. Keep the condition order as above until the standard fix is delivered via continuous feature delivery.

See Also

SAP Help Set Substitution/Validation Log (Help Portal)

Keywords

validation, substitution, journal entry, general journal entries, precondition, trading partner, partner company, company code, code generation, is not empty, is initial, and condition, rule logic, validation error, posting blocked, abap backend

 
 
phần phụ trợ
, KBA , FI-SL-VSR-2CL , Validation, Substitution and Rules (Public Cloud) , Problem

Product

SAP S/4HANA Cloud Public Edition all versions