This page is not a part of an official Int4 documentation.
Knowledge Articles

6. SAP Backend Validation Approach 3 - Creating Database Validation Rulesets from scratch

Overview

In this scenario, you will create a Database Validation ruleset to ensure data consistency between different SAP environments. The process allows you to perform automated cross-system comparisons (e.g., SAP ECC vs. S/4HANA) at the table level.

This guide focuses on the core configuration of validation rules—defining how the system should read, link, and compare data to identify discrepancies automatically.

At the end of this guide you will have:

  • A selection of specific SAP tables and fields targeted for validation.

  • Configured DB Validation ruleset that knows how to handle matches, mismatches, and data transformations.

  • Reusable set of rules that can be used to validate business documents across your SAP landscape.

Step-by-step instructions


  1. Open the Database Validation Resources app and create a new ruleset

1b04b46b560a4609bc63fa6e74a14c48?workflows_screenshot=true
  • Go to the application called Database Validation Resources.

  • Click Create.

  • Enter a ruleset ID, for example: DEMO_RULESET_SO.

  • This creates the base object where all validation logic will be configured.

  1. Define the first table and its comparison field 1:12

eb0bbb8eae564a3c88dddd3844fed7f7?workflows_screenshot=true
  • Add the first table to validate, in this example VBAK.

  • Add the field you want to use for selection, such as BSTNK.

  • Set the selection option to Equals.

  • Set reference type to Variable.

  • Use a variable to fetch the value, named P0 in the demo.

  1. Configure comparison rules for fields in the first table

4b8f89b9d5e54df5a7319be2bddf0953?workflows_screenshot=true
  • Add the fields you want to compare from the first table.

  • For each field, define how the system should react:

    • Error for critical mismatches,

    • Warning for less critical differences,

    • or leave it empty if no special handling is needed.

  • You can also apply rules based on the field name so the logic works even when field values vary.

  • If needed, enable masking to hide sensitive output values.

  1. Add the second table and link it with a reference variable

5c4cfc277c3c4256bbb22d155074709a?workflows_screenshot=true
  • Switch to the second table, VBAP.

  • Select the relevant field and set the selection option to Equals.

  • Use the reference variable DB Parent ID Reference so the second table is compared against the parent document context.

  • This is used to compare related positions or line items from the document.

  1. Set comparison behavior for the second table

  • Choose which fields should be compared in the second table.

  • Apply rules such as:

    • Error for fields that must match exactly,

    • Warning for fields where differences are acceptable,

    • Mask for fields that should not be fully visible.

  • In the demo, the matching criteria are set using values like POSNR.

  • Save the ruleset.

  1. Attach the ruleset to the automation object

94927806b22b459e951bee7f191fe180?workflows_screenshot=true
  • Enter edit mode for the automation object.

  • Find the section called Database Validations.

  • Add the new ruleset by either:

    • copying and pasting it, or

    • using the helper box to select the ruleset from the list.

  • Save the automation object after the ruleset is attached.

  1. Run the test case and review the validation result

c843e9b97d3e458c900b914b97f450d4?workflows_screenshot=true
  • Open API Tester Cockpit.

  • Edit and execute the test case.

  • Review the result of the database validation.

  1. Inspect the comparison output and understand the result

b6180b8a6a124cefb9a608d5a364c0d5?workflows_screenshot=true
  • The system shows a side-by-side comparison:

    • the gray entry is the reference document from production,

    • the entry below is the current execution.

  • Matching fields appear as equal.

  • Differences are highlighted:

    • warning values are shown differently,

    • error values are marked in red.

  • Masked fields, such as the net value, are hidden based on the ruleset settings.

  • You can also enable a view that shows only the differences to focus on what changed.

  1. Key takeaway

d0eb3be85ae1467291f37e3edf05c960?workflows_screenshot=true
  • This demo shows the basic flow for creating and using Data Base Validation Rulesets.

  • The same approach can be expanded with more advanced options.

  • The main idea is to define tables, fields, and rules so SAP database comparisons can be validated automatically.

Useful links:

https://help.int4.com/int4-suite-knowledge-center-library/3.15/db-validation-rulesets

https://help.int4.com/int4-suite-knowledge-center-library/3.15/variables