Configuring Data Validation

Objectives

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:

  1. Identify the validations that are needed.
  2. Consider using rules like the ones that are delivered.
  3. Create the validation rules (basic or composite).
  4. Create the validation method.
  5. Export rules, methods, and selections (used in rules) from the source system.
  6. Import rules, methods, and selections (used in rules) into the target system.
  7. 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
  8. Transport the assignments.

Delivered Validation Rules

The delivered validation rules are listed

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:

  1. 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.
  2. Tolerance: The amount within which the difference between the calculated values of left and right formulas can be ignored.
  3. Tolerance Currency: Specify a tolerance currency if needed. For example, you need to view to the validation results in an alternative currency.
  4. Comments Required: Select this checkbox if comments are needed in the Manage Data Validation Tasks app.
  5. 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.
  6. 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.
The rule general information has a zero tolerance

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 left formula is current year retained earnings. the right formula is annual net income

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):

  1. Alias: Enter Assets
  2. Operand: Select Sum
  3. Select YTD: Year-To-Date
  4. Select Amount
  5. Where: FS hierarchy node
  6. Choose Incl. Equal To
  7. Member ID: Asset hierarchy node
The assets expression is based on the assets fs item 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:
    • FS Item | Value | Equal to | 317000.
    • FS Item | Selection attribute | Elimination attribute | Equal to | S-IUE-PL-GP.
    • FS Item | Target attribute | NCI target | Equal to | NCI item 321500.
    • FS Item | Hierarchy node | Equal to | Hierarchy node.
    Note
    Also to FS item, any other dimension in group reporting can be used in the Where clause.
  • Add Operand: Adds an operand to the end of the selected formula.
  • Reset: Clears the inputs for the operand being edited.

You can watch the on line help video to see how to build a validation rule:

Create Validation Rule

Rule Expression Example

In the following example, assets are compared to liabilities and owners equity.

The Assets are selected in the Where definition as follows:

  1. Financial Statement Item
  2. Incl. Like
  3. 1*: Select all FS items that begin with the number 1.

The Liabilities are selected in the Where definition as follows:

  1. Financial Statement Item
  2. Incl. Like
  3. 2*: Select all FS items that begin with the number 2.

The Owners Equity is selected in the Where definition as follows:

  1. Financial Statement Item
  2. Incl. Like
  3. 3*: Select all FS items that begin with the number 3.

Validation Rule Example

The assets expression is based on an include like operator for 1*

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.
The reference link is the consolidation journal entry view

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.

the left formula, comparison operator, and right formula are displayed

Simulation

You can use the Simulate option to test the validation while you build it.

The left and right values agree for each segment

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
  • Set the tolerance to zero
  • Comments shouldn't be required

Task 2: Create a Data Validation Rule for Assets, Liabilities, and Equity

Business Scenario

You need to create a new validation rule for the ABC Corporation project to check the balance sheet.

What skills will you develop in this practice exercise?

  • Create a validation rule for assets, liabilities, and owners equity
  • Set the tolerance to zero
  • Comments shouldn't be needed
  • Simulate the rule

Compound Validation Rules

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?

  • Create a validation method
  • Assign your validation rules

Validation Assignments

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:

  1. Select Version.
  2. Select Period Category: The assignment is to periods is made via the period category.
  3. Select Consolidation Units and Validation Method: Assign the validation methods to the consolidation units.
  4. Choose Save.
  5. 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

Log in to track your progress & complete quizzes