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
-
Open the Database Validation Resources app and create a new ruleset
-
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.
-
Define the first table and its comparison field 1:12
-
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.
-
Configure comparison rules for fields in the first table
-
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.
-
Add the second table and link it with a reference variable
-
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.
-
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.
-
Attach the ruleset to the automation object
-
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.
-
Run the test case and review the validation result
-
Open API Tester Cockpit.
-
Edit and execute the test case.
-
Review the result of the database validation.
-
Inspect the comparison output and understand the result
-
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.
-
Key takeaway
-
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