4 8 - Validation and Substitution
4 8 - Validation and Substitution
44..88__V
Vaalliiddaattiioonn aanndd S
Suubbssttiittuuttiioonn
1 of 32
Contents
1.
2.
3.
4.
5.
6.
2 of 32
Course Overview
This training document covers the Validations and Substitutions, its definition, use and
management. It also explains the configurations and demonstrations on Validations and
Substitutions.
1. Topics Covered
After study of this document participants would be able to explain:
1. Execution of validation and substitution
2. Basics of creating a validation and a substitution
3. Validation and substitution maintenance
2. Business Scenario
The head accountant of ABC International is concerned about the number of data entry mistakes
that take place in accounting the transactions. It is required to ensure that certain basic validation
has to been done before the document is posted in the system.
Following paragraphs of this course material takes us through the various process of using
validations and substitutions for concerns raised by the Head accountant of ABC Shipping
Corporation.
3 of 32
Prerequisite The conditions which should be satisfied for the system to trigger the
validation
Check Once the validation is triggered, what is the validation that the system has to
perform
Message In case the Check has failed, what is the Message the system has to give to
the user?
Enter the application area in which the validation is called up e.g. In Financial Accounting
or in Controlling etc.
Select the correct Call up point for the validation e.g. at the header level or the line item
level or the Complete document level.
Define the validation.
Assign your validation to an organizational unit (for example, company code for FI,
company code or global company for FI, controlling area for CO) and
Activate the Validation.
The fields that can be used in your validation or substitution are determined from the application
area and the Callup point. When you define your rules for the prerequisite and Check statements,
you can choose the fields that you want to use.
Formula Builder
The Formula Builder provides an easy-to-use interface for inputting arithmetical and logical
expressions.
Depending on the context for the formulation required, you are given buttons to press which
provide Operands and Operators for logical expressions which have to be inserted in the formula.
The entry is checked step by step for correct syntax including parentheses.
4 of 32
Depending on the entries the system will only allow to dispose of the correct logical formulation to
guarantee a fully correct statement. Errors in entering the rules are therefore scored out.
The use of technical names, as was the case in the past (tables and field names) is still
supported, but here the options that can used are delivered using press buttons and texts. This
enhances the comfort of handling a logic which is intrinsically technical.
Validation Maintenance
Each validation can contain up to 999 steps that each consist of a
Prerequisite
Check
Message
You can use a message that has already been defined or you can create a new message for the
validation. The messages to be output can have different levels of severity:
I = Information
W = Warning
E = Error (the user must correct the entry)
C = Cancel
Operands /
Operators
Description
AND
Used to check more than one condition and the result must be true for
both for the system to proceed
OR
Used to check more than one condition and the result must be true for any
one of the condition for the system to proceed
Equal to
<>
Not equal to
<=
>=
>
Greater than
<
Less than
5 of 32
IN
SUM
Total of a document
AVG
MAX
MIN
GROUP BY
4.1.4. Demonstration
Demo 1: Example Business Scenario for Validations
To have a validation to ensure that the particular user, (Current User ID) should not pass any
journal vouchers using the document type SA. In case the user trys to post, then the system
should throw an error message.
Menu Path
Transaction Code
Click on the Documents Header of the Financial Accounting, and Click the Validation
button
Value
Validation Name
YVAL
Validation Text
Value
Step No
001
Step Name
Tab
Prerequisite
Sub Tab
Table fields
6 of 32
Table
Structure SYST
Field
SYST-UNAME
Operator
Constant
Current User ID
Operator
AND
Field
BKPF-BUKRS
Operator
Constant
AB00
Tab
Check
Sub Tab
Table Fields
Table
Structure BKPF
Field
BKPF BLART
Operator
<>
Constant
SA
Tab
Message
Message Type
Message Class
Z1
Message Number
100
Message Text
Message Variables
BKPF
7 of 32
Transaction Code
Company code
AB00
Call up point
001
Validation
YVAL
Activation level
01
8 of 32
Transaction Code
Field
Value
Company code
AB00
Document date
Todays date
Posting Date
Todays date
Document type
SA
Posting key
40
GL account
476900
Prerequisite
Rule Manager
Steps
Message
2. Validations are system defined checks for specific fields when a business transaction is being
processed.
True
False
4.1.6. Tasks
1. To have a validation to ensure that the particular user, (Current user ID) should not pass any
journal vouchers using the document type SA. In case the user tries to post, then the system
should throw an error message.
9 of 32
4.1.7. Solutions
Task 1:
Step 1: Creation of a validation
Menu Path
Transaction Code
Click on the Documents Header of the Financial Accounting, and Click the Validation
button
Value
Validation Name
VAXX
Validation Text
Value
Step No
001
Step Name
Tab
Prerequisite
Sub Tab
Table fields
Table
Structure SYST
Field
SYST-UNAME
Operator
Constant
Current User ID
Operator
AND
Field
BKPF-BUKRS
Operator
Constant
ABXX
Tab
Check
10 of 32
Sub Tab
Table Fields
Table
Structure BKPF
Field
BKPF BLART
Operator
<>
Constant
SA
Tab
Message
Message Type
Message Class
Z1
Message Number
1XX
Message Text
Message Variables
BKPF
Transaction Code
Field
Value
Company code
ABXX
Call up point
001
Validation
VAXX
Activation level
01
11 of 32
Field
Value
Company code
ABXX
Document date
Todays date
Posting Date
Todays date
Document type
SA
Posting key
40
GL account
476900
Enter the application area in which the substitution is called up e.g. Financial accounting
or Controlling etc
Select the correct Callup point for the substitution e.g. Header or line item
Define the substitution.
Assign your substitution to an organizational unit (for example, company code for FI,
company code or global company for FI, controlling area for CO).
12 of 32
Activate the Substitution. The fields that can be used in your substitution are determined
from the application area and the Callup point. When you define your rules for the
prerequisite and check Statements, you can choose the fields that you want to use.
Substitution Activation
An organizational unit
A Call point e.g. Header or Line item
5.1.4. Demonstration
Demo 1: Create a substitution rule
Create a substitution rule to ensure that the long text in the document has to be filled up with
Testing Substitution rule for company code AB00
Menu Path
Transaction Code
Field
Value
Click on Environment
Substitution
Call point
001
Substitution
SUB00
Description
Click on
Step
Field
to
Substituted
be
BKPF-BKTXT
Substitution method
Constant Value
Tab
Prerequisite
Sub Tab
Table fields
Table
Structure BKPF
Field
BKPF BUKRS
Operator
Constant
13 of 32
Transaction Code
Field
Value
Company code
AB00
Call up point
001
Substitution
SUB00
Activation level
01
Transaction Code
Field
Value
Document Date
Todays date
Type
SA
Company Code
AB00
Currency
INR
No Document Text
Posting key
40
GL Account
476900
Amount
6500
Text
Posting key
50
GL Account
113100
Amount
6500
14 of 32
Value Date
Todays date
Text
True
False
2. ______________ establishes which conditions must be fulfilled before the substitution can
be performed.
Prerequisite Statement
Substitution Values
Substitution Exists
3. Call
5.1.6. Tasks
1. Create a substitution step to ensure that whenever the company code is ABXX, and the
General ledger account is 416300, then the profit center should be ABXX.
2. When the Company code is ABXX and the GL Account is 470001 or 416300 and the entry
pertain to a vendor invoice created in finance department, the profit center should be ABXX
5.1.7. Solutions
1. To create a substitution rule to ensure that whenever the company code is ABXX, and the
General ledger account is 416300, then the profit center should be ABXX, please go to the
following node:
Step 1: Create a new substitution rule as per the following details
Menu Path
Transaction Code
15 of 32
Field
Value
Click on Environment
Substitution
Call point
002
Substitution
SUBXX
Description
Click on
Step
Field
to
Substituted
be
BSEG PRCTR
Substitution method
Constant Value
Tab
Prerequisite
Formula
Field
BSEG-PRCTR
Constant
ABXX
Transaction Code
Field
Value
Company code
ABXX
Call up point
002
Substitution
SUBXX
Activation level
01
16 of 32
Field
Value
Document Date
Todays date
Type
SA
Company Code
ABXX
Currency
INR
Test Substitution
Posting key
40
GL Account
416300
Amount
6500
Profit Center
Posting key
50
GL Account
113100
Amount
6500
Value Date
Todays date
Text
Transaction Code
17 of 32
Field
Value
Click on Environment
Substitution
Call point
002
Substitution
SUBXX
Description
Click on
Step
Field
to
Substituted
be
BSEG PRCTR
Substitution method
Constant Value
Tab
Prerequisite
Formula
BKPF-BUKRS = ABXX AND ( BESG-HKONT = 416300 OR BSEGHKONT = 470001) AND BKPF-BLART = KR|
Field
BSEG-PRCTR
Constant
ABXX
Transaction Code
Field
Value
Document Date
Todays date
Type
KR
Company Code
ABXX
Currency
INR
Vendor Invoice
Posting key
31
GL Account
1000
Amount
5000
18 of 32
Posting key
40
GL Account
416300
Amount
5000
Profit Center
Text
6.1.1. Definition
Rules
A rule is a logical statement that you can use in a prerequisite statement, a check, or another
rule.
Sets
A set is a flexible data structure for portraying arranged amounts and hierarchies.
Sets are maintained and administrated centrally.
Sets
They are used in almost every component of the FI-SL system: in Boolean logical formulas in
validation, substitution and ledger selection, during allocation (assessment/distribution), in
planning, in roll-ups, in currency conversion, etc. To improve system performance, you should
use basic or single-dimension sets rather than long lists of Boolean statements or user exits.
In many cases for the creation of the validation and substitution, the need could be to use many
number of values for a particular field. For e.g.
The prerequisite could be as follows:
19 of 32
Where the company code is ABXX or CDXX or EFXX or GHXX. Also the list of such
company codes may be dynamic. I.e. in case there is a new company code, then the changes
have to be made in the formula.
Now, instead of creating the formula with so many values for the same field company code, a set
can be created.
Set is a collection of many values of the same field which is used in the creation of validation and
substitution prerequisite or check steps. In the above case, a set SET1 could be created with
values ABXX, CDXX, EFXX and GHXX. In the formula builder the prerequisite could be
created as below:
Sets
Syntax rule: table name - field name IN set name
Example above: If the user is contained in set USER-GROUP, a check is made whether this user
uses a corresponding account (included in set ACCOUNT-MANAGEMENT).
6.1.4. Demonstration
Demo 1: Example Business Scenario for Rule
If the Prerequisite for validation step is as follows:
Where the Company code is AB00 and the Document type is SA and the GL account is
220000
Check: The system should not allow posting more than Rs.1000/- to this GL Account.
The formula for the above would be built as follows:
BKPF-BUKRS = AB00 AND BKPF-BLART = SA AND BSEG-HKONT = 220000
This prerequisite could be used in more than one validation. Instead of typing the formula for
each validation step, this formula can be saved as a rule. E.g. RULE2
RULE2 = BKPF-BUKRS = AB00 AND BKPF-BLART = SA AND BSEG-HKONT = 220000
Validations and Substitutions
20 of 32
Menu Path
Transaction Code
Select the Rule and click the Create Rule Button in the Menu Bar.
Field
Value
Rule Name
RULE2
Rule Description
Click the save button or CTRL + S, Double click on the Structure BKPF - Accounting Document
Header and give the CONSTANT VALUE in the following fields.
Field
Operator
Value
Operator
BKPF-BUKRS
AB00
AND
BKPF-BLART
SA
AND
BSEG-HKONT
220000
After we complete the Rule, with the company code and Document type and GL Account the Rule
Screen should look like below.
21 of 32
Transaction Code
22 of 32
Field
Operator
Value
BSEG-WRBTR
<
1000
Value
Message Type
Message Number
025
Message Text
than
Menu Path
Transaction Code
Field
Value
Company code
AB00
Document date
Todays date
Posting Date
Todays date
Document type
SA
Posting key
40
GL account
220000
Amount
2000
Value Date
Todays Date
Text
Press enter
An error message is displayed which is created in the Demo Step 2.
23 of 32
Transaction Code
Field
Value
Set Name
YSET1
Tab
Basic Data
Table
BSEG
Filed Name
HKONT
From Value
200000
To Value
220999
Short Text
Transaction Code
24 of 32
Select the validation YVAL created in Demo 1 and create a new Step.
Click Create Step button
Field
Value
Validation Step
001
Validation Description
Tab
Prerequisite
Sub Tab
Table Fields
Structure
Field
BKPF-BUKRS
Operator
Constant
AB00
Field
BKPF-BLART
Operator
Constant
SA
Sub Tab
Table Fields
Structure
Field
BSEG-HKONT
Operator
IN
Set Directory
YSET1
Tab
Check
Sub Tab
Table Fields
Structure
Field
SYST-UNAME
Operator
<>
Constant
Your User ID
25 of 32
Value
Message Type
Message Number
031
Message Text
Message
Variables
SYST-UNAME
Transaction Code
Field
Value
Company code
AB00
Document date
Todays date
Posting Date
Todays date
Document type
SA
Posting key
40
GL account
220000
Amount
2000
Value Date
Todays Date
Text
Press enter
An error message is displayed which is created in the Demo Step 3.
26 of 32
True
False
6.1.6. Tasks
1. Create a Rule at Document Header Level, that a particular user, (Having user ID XXXXXX
(Current user id) should not post any Document upto to 25.12.2009 for document type DA. In
case the user tries to post, then the System should throw an error message.
2. Create a validation at Document Header Level for company code starting from AB00 to AB99
to ensure that the current user ID is not able to post the document type KA.
6.1.7. Solutions
Task 1:
Step 1: Creation of a Rule in Validation
Menu Path
Transaction Code
Click on the Line Item of the Financial Accounting, and Click the Rule button
following screen is displayed.
Field
, the
Value
Rule Name
RULEXX
Rule Text
27 of 32
Field
Value
Rule Definition
TAB
Table Fields
Structure
Field
BKPF-BUKRS
Operator
Constant
ABXX
Operator
AND
Field
BKPF-BLART
Operator
Constant
DA
TAB
Table fields
Structure
Field
SYST-UNAME
Operator
Constant
Your User ID
Field
Value
Step No
XXX
Step Name
Tab
Prerequisite
28 of 32
Sub Tab
Rules
Rule
RULEXX
Tab
Check
Sub Tab
Table Fields
Table
Structure BKPF
Field
BKPF BLDAT
Operator
>
Constant
25.12.2009
Tab
Message
Message Type
Message Class
Z1
Message Number
2XX
Message Text
The user id & can post the document DA type only after
25.12.2009
Message Variables
SYST-UNAME
Transaction Code
Field
Value
Company code
ABXX
Document date
Todays date
Posting Date
Todays date
Document type
DA
Posting key
40
GL account
476900
29 of 32
Click enter to see the validation error message configured in the above task.
Task 3:
Step 1: Creation of a Set
Menu Path
Transaction Code
Field
Value
Set Name
YSETXX
Tab
Basic Data
Table
Filed Name
BUKRS
From Value
AB00
To Value
AB99
Short Text
Transaction Code
Select the validation rule VAXX and Click Create Step button
Field
Value
Validation Step
XXX
Validation Description
Tab
Prerequisite
Sub Tab
Table Fields
Structure
30 of 32
Field
BKPF-BUKRS
Operator
IN
Set Directory
YSETXX
Operator
AND
Structure
Field
SYST-UNAME
Operator
Constant
Current user ID
Tab
Check
Sub Tab
Table Fields
Structure
Field
BKPF-BLART
Operator
<>
Field
KA
Value
Message Type
Message Number
3XX
Message Text
Message
Variables
SYST-UNAME
31 of 32
Field
Value
Company code
ABXX
Document date
Todays date
Posting Date
Todays date
Document type
KA
Posting key
40
GL account
220000
Amount
2000
Value Date
Todays Date
Text
Press enter
An error message is displayed which is created in the above step.
32 of 32