Use of Message Variables

Use

You use message variables in a message you have assigned to the validation result to display values that either (a)are calculated in the formula of a validation rule or (b)flow into the formula. This feature makes the validation result immediately transparent and plausible, thereby saving you the need for time-consuming rechecking and calculating of individual document line items. Message variables are most beneficial in messages intended for negative results.

Integration

When variables are embedded in a formula of a validation rule, the system transfers the value of the variable determined during runtime to the messages assigned to the validation results. You edit these messages in Message Maintenance . When editing messages for a validation rule, you can navigate directly from the consolidation workbench to Message Maintenance.

Prerequisites

The messages you assign to validation rules contain variables in the short text and long text, and those variables can be substituted with values from the validation rule.

Features

General

To use message variables, you first need to:

  • Create one or more message classes in the customer namespace (in Message Maintenance). Within these message classes, you create messages that describe the various results of a specific validation rule. You insert variables in the short or long text of these messages, which are then substituted with values computed during validation runs.

  • In the definition of validation rules, you define which values substitute which variables.

You can use up to four variables per message. The names of the variables are predefined. They all start with ampersands and are numbered from one to four: &1 , &2 , &3 , &4 .

Note Note

The following applies when validation rules have one or more grouping characteristics: Up to four variables are available (as is also true otherwise) for the different messages issued according to the check result. However, here the system always substitutes the fourth variable with a concatenated string of the values of the grouping characteristics used for the current check. For more information, see Validation with Grouping Characteristics .

End of the note.
Defining Message Variables

How you define message variables for a validation rule depends on the validation type of the validation method:

Data Rows are Totaled

When you insert the variables you need into the formula that belongs to a validation rule, where you insert each variable determines what that variable represents. The position of the variable determines the variable’s content: In the formula editor, you insert each variable after the function that provides the value of the variable.

To insert a variable in a formula, you position the cursor behind the appropriate function, choose the Comment button of the formula editor, and specify one of variable names.

Note Note

Make sure you insert the variable directly behind the name of the function – even if the function has parameters. In this case, place the variable between the function name and the parameters (which are set in parentheses).

End of the note.
Data Header; Individual Data Rows

For these two validation types, you define message variables in the input fields shown on the screen by entering the name of the field each variable should represent. You can use input help to list all fields (characteristics and key figures) of the data stream you have chosen for the method.

If a characteristic you have chosen contains attributes, you can also choose the desired attribute. If you do this, at runtime the system allocates the value of the attribute to the variable, instead of the value of the characteristic.

Note Note

If you want a message to output both the characteristic value and the attribute value, assign the characteristic (without selecting an attribute) to one variable and assign the same characteristic including the attribute to a second variable.

End of the note.

Example

You want to use a validation method to check whether a balance sheet’s total assets are equal to the total liabilities (including stockholders' equity). You want a message to display the result of the check. If the result is negative (that is, the balance does not equal zero), you want the message to display three amounts: total assets, total liabilities, and the balance.

First, you create the message class ZVAL in Message Maintenance and add two new messages to the message class:

  • 001: “Assets and liabilities have a balance of zero”

  • 002: “Assets (&1) and liabilities (&2) do not balance. Difference = &3“

In the Consolidation Workbench, you create a validation method with the type Data Rows are Totaled and you define a validation rule with the following formula:

VAL_YTD ( assets ) + VAL_YTD ( liabilities ) = 0

To allocate the values that flow into the formula to the message variables, do the following:

  1. In the formula editor, place the cursor behind the first function name and choose Comment .

  2. Enter &1 into the input field.

  3. In the formula editor, place the cursor behind the second function name and choose Comment .

  4. Enter &2 into the input field.

  5. In the formula editor, place the cursor in front of the second function name and choose Comment .

  6. Enter &3 into the input field.

Now the formula looks like this:

VAL_YTD “&1” ( assets ) + “&3” VAL_YTD “&2” ( liabilities ) = 0

Now, add a message to the validation rule for the positive result. For the Message ID enter message class ZVAL , for Message enter 001, and for MessageType enter I (informational).

Repeat the same procedure for the negative result; however, specify message 002 . Since an unbalanced balance sheet is not auditable, for this message you specify the message type E (error).