After completing this lesson, you will be able to configure data validation
Implementation Steps for Data Validation
At ABC Corporation, you have unique data validation checks that you need to run each month. These are the implementation steps that you'll follow:
Identify the validations that are needed.
Consider using rules like the ones that are delivered.
Create the validation rules (basic or composite).
Create the validation method.
Export rules, methods, and selections (used in rules) from the source system.
Import rules, methods, and selections (used in rules) into the target system.
Assign the method to task IDs, consolidation units, and consolidation groups. There are three task IDs:
1080 Reported Data Validation
1180 Standardized Data Validation
2980 Consolidated Data Validation
Transport the assignments.
Delivered Validation Rules
The delivered validation rules are used as best practice examples to consider when designing your own solution.
SAP delivers many validation rules that verify data correctness according to basic financial principles, such as the following:
Net income calculated in the income statement must equal retained earnings in the balance sheet
Total assets must equal the sum of the total liabilities plus the sum of total equity
The net accounting value of land and buildings must be greater than or equal to 0.
Basic Validation Rules
You can only create validation rules in the customer namespace (rule IDs not starting with the prefix S).
Three Components of a Basic Validation Rule
General Information
Rule Expression
Reference Links
General Information
The settings in the General Information tab are as follows:
Group By: Determine how data is organized on the validation result screen of the Manage Data Validation Tasks app. For example, if you choose profit center as the Group By dimension, then values by profit center (and consolidation unit) will be displayed in the validation log.
Tolerance: The amount within which the difference between the calculated values of left and right formulas can be ignored.
Tolerance Currency: Specify a tolerance currency if needed. For example, you need to view to the validation results in an alternative currency.
Comments Required: Select this checkbox if comments are needed in the Manage Data Validation Tasks app.
Control Level: Specify whether a failed validation result leads to an error status of the respective validation task in the monitors. There are three control levels:
Error: If the validation rule fails, the task can't be blocked in the data monitor.
Warning: If the validation rule fails, the task can be blocked in the data monitor.
Information: If the validation rule fails, the task can be blocked in the data monitor.
Process No Data As: Specify whether a validation result with no data leads to an error status of the respective validation task in the monitors.
Validation rules can only be configured in SAP Fiori with the Define Validation Rules app. With this app, you define validation rules that contain the logical conditions that the relevant financial data should fulfill. The defined validation rules can be used to verify reported data, standardized data, and consolidated data along the consolidation process.
Rule Expression
In the following Validation Rule Formula Concept image, annual net income is being checked to see if it equals current-year retained earnings.
Left Formula:
Alias: NI-BS
FS Item: 317000 Current year retained earnings
Subitem: 915
Right Formula:
Alias: NI-PL
FS Item: 799000 Annual net income
Operand: -1
The Rule expression is composed of a left formula comparison operator, and a right formula.
Each formula is a set of data that you filter using certain criteria. For example, the sum of year-to-date amounts posted with a range of FS items. You can also use fixed amounts, constant numbers, quantities, and mathematical operators when composing each formula.
To build a validation formula, follow these steps (also displayed in the following Steps to Build a Validation Formula image):
Alias: Enter Assets
Operand: Select Sum
Select YTD: Year-To-Date
Select Amount
Where: FS hierarchy node
Choose Incl. Equal To
Member ID: Asset hierarchy node
Expression Definitions
Left and right formula function: f(x): This function controls the output from the left or right formula. For example, Sign displays a value of 1 if the calculated value is positive, 0 if the value is zero, and -1 if the value is negative.
Alias: Alias is a user-defined name that displays on formulas, The alias also displays as mouse-over text in the Manage Data Validation Tasks app, providing hints about how the left value and right values are calculated.
Formula function: f(x): The f(x) function (to the right of Alias) controls the values used by the validation rule. For example, use the f(x) default to compare the values are they're in the database. Use an f(x) value of ABS to compare the absolute values.
Operand: There are four types of operands:
Amount: Check for a specific value.
Quantity: Check for a specific quantity.
Sum: Calculate the values based on the formulas.
Number: A constant that is used in multiplication or division, or compared with a ratio.
Note
Each operand can be used to select data for time periods such as: the period, period of previous period, period of previous year, year-to-date, year-to-date of previous period, year-to-date of previous year, and opening balance. Also, each operand is used with either amounts, amounts in transaction currency, or quantity. For example, when running reported data validation, the amounts (in local currency) are used in the validation for each consolidation unit.
Use Selection: Use selection objects instead of the Where selections.
Where: Where the values are coming from, the operand, and the object id. For example:
In the following example, assets are compared to liabilities and owners equity.
The Assets are selected in the Where definition as follows:
Financial Statement Item
Incl. Like
1*: Select all FS items that begin with the number 1.
The Liabilities are selected in the Where definition as follows:
Financial Statement Item
Incl. Like
2*: Select all FS items that begin with the number 2.
The Owners Equity is selected in the Where definition as follows:
Financial Statement Item
Incl. Like
3*: Select all FS items that begin with the number 3.
Validation Rule Example
Reference Links
In the Reference Links area, you can add static URL links or dynamic links that contain variables. The links provide more contextual information on the rule. You can drill through for more details, especially when validation fails for a specific rule.
App-specific parameters: For example, if you want to have a reference link that points to an SAP Fiori app, it has the form #<semanticObject>-semantic action, for example #ConsolidationJournalEntryList-listDisplay
Request-specific parameters: Use the listed "properties" in the form of propertyname=<propertyname> or <propertyname>, for example, ScenId=FINCS&Tasktype=<Tasktype>&Unit=<Unit>&<Drruuid>, without specifying the exact values in most cases.
The exact link form depends on the target webpage. You aren’t expected to formulate the dynamic link from scratch. You can copy an example target webpage, and modify the URL.
Display Rule Detail
After you create your validation rule, you can use the Display Rule Detail to display a condensed preview of the rule expression in detail. The preview contains a left formula, comparison operator, and right formula.
Simulation
You can use the Simulate option to test the validation while you build it.
Create Data Validation Rules
Task 1: Create a Data Validation Rule for Annual Net Income and Retained Earnings
Business Scenario
You need to create a new validation rule for the ABC Corporation project to check annual net income and retained earnings.
What skills will you develop in this practice exercise?
Create a validation rule for annual net income and retained earnings
At ABC Corporation, you require a data validation in which both basic rules 1 and 2 are met, or the basic rule 3 is met. To perform this validation, create a compound rule that has the rule expression (1 AND 2) OR 3 = TRUE.
Compound Validation Rules - Key Features
Several validation rules can be included in a compound rule with logical operators.
The result of running the compound rule depends on the result of the underlying basic rules and the relationship defined by the logical operators.
Preconditions: Basic rules should exist before creating a compound type rule.
Assign compound rule to method just like basic rules.
No simulation for compound rules.
When displaying the validation log, the result of both compound rule and the underlying basic rules is displayed.
The control level of the basic rules has no impact on the compound rules.
The logical operators work as follows:
AND: Returns TRUE if both basic rules connected by the operator evaluate to TRUE.
OR: Returns TRUE if any of the two basic rules connected by the operator evaluates to TRUE.
NOT: Reverses evaluation result of the basic rule that follows the operator, for example, if the rule evaluates to TRUE, then FALSE is returned and vice versa.
Use this link for more information on how to create compound validation rules (including a video):Create Compound Rules
Validation Methods
Create Validation Methods
After you create validation rules, you assign them to validation methods.
You can configure validation methods with the Define Validation Methods app. With this app you can create or update validation methods that may contain multiple groups of validation rules.
If necessary, you can drag and drop rules to change their sequence or group assignment. The rule sequence and grouping will determine the layout of the validation result page in the Manage Data Validation Tasks app.
You can only add one group hierarchy level and then include rules within each group. In other words, you can’t add a group under another group.
SAP pre-delivers the validation method SRD1 that includes predefined rules. You can only create methods in the customer namespace (method IDs not starting with the prefix S).
The Define Validation Methods app contains Web assistant documentation for key fields and concepts. To display the documentation while working in the app, press F1 or click the question mark displayed in the app header.
Import and Export Data Validations
Validation rules and methods aren't transported between systems. Therefore, they must be exported from the source system and then imported into the target system.
You can use the Import and Export Validation Rules and Methods app to move validation rules, methods, and selections between systems. This is useful when you want to import the rules and methods defined and tested in your quality system to your production system.
To reduce your waiting time when activating many rules or methods, you can run a program that runs at night. Go to the Define Background Job program (transaction code SM36) and schedule a background job that runs the VEC_IMPORT_EXPORT_RULE program.
When you perform the download from the source system, select the relevant Selections, Validation Rules, and Validation Methods.
Note
The Selections in this context are the ones used in validation rules, if any.
When you perform the import into the target system, select the relevant file. If the objects were imported previously, they'll appear in the Duplicated tab.
When you do the import, you can activate the objects at the same time.
Create Data Validation Methods
Business Scenario
Now that you've created validation rules, you need to create a new validation method for the ABC Corporation project.
What skills will you develop in this practice exercise?
You can assign methods via the Assign Validation Methods app. With this app you can assign validation methods to consolidation units for reported data validation and standardized data validation. You can also use this app to assign validation methods to consolidation groups for consolidated data validation. You can run validation tasks for your consolidation groups and units only after the method assignment.
When you access the Assign Validation Methods app, select the Task ID.
You can follow these steps when assigning validation methods to consolidation units:
Select Version.
Select Period Category: The assignment is to periods is made via the period category.
Select Consolidation Units and Validation Method: Assign the validation methods to the consolidation units.
Choose Save.
Enter a transport request.
Because the method assignment is version-dependent, you can assign different methods for actual data and budget data.
The delivered period category contains all 16 periods.
Note
You can use the Assignment List to list assigned methods for each consolidation group or unit for the current task type.
Because validation task id 2980 is only relevant for consolidated data, the methods are assigned to consolidation groups.
Because validation assignments are transportable, you need to provide a customizing request when saving the assignment.
Assign Data Validation Methods
Business Scenario
Now that you’ve created your validation rules and method, you need to assign your validation method to your consolidation units and groups.
What skills will you develop in this practice exercise?
Assign a validation method to the consolidation units for reported data
Assign a validation method to the consolidation units for standardized data
Assign a validation method to the consolidation groups for consolidated data