100% found this document useful (1 vote)
420 views

4 8 - Validation and Substitution

This document discusses validations and substitutions in financial accounting. It defines validations and substitutions, explains how they are configured and executed, and provides examples of how they can be used to check for errors in accounting documents. Demonstrations show how to create a validation to prevent a specific user from posting a journal voucher with a certain document type and how substitutions can replace values if predefined conditions are met.

Uploaded by

Kalyan Chowdary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
420 views

4 8 - Validation and Substitution

This document discusses validations and substitutions in financial accounting. It defines validations and substitutions, explains how they are configured and executed, and provides examples of how they can be used to check for errors in accounting documents. Demonstrations show how to create a validation to prevent a specific user from posting a journal voucher with a certain document type and how substitutions can replace values if predefined conditions are met.

Uploaded by

Kalyan Chowdary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

4_Financial Accounting_GL/AR/AP

44..88__V
Vaalliiddaattiioonn aanndd S
Suubbssttiittuuttiioonn

Validations and Substitutions

1 of 32

Contents
1.

Topics Covered ................................................................................................................ 3

2.

Business Scenario ........................................................................................................... 3

3.

Basics of Validations and Substitutions ......................................................................... 3

4.

Definition and execution of Validation in Financial Accounting .................................... 3


4.1.1.
Definition ............................................................................................................... 3
4.1.2.
Business use/Purpose ........................................................................................... 4
4.1.3.
Customization Considerations................................................................................ 4
4.1.4.
Demonstration ....................................................................................................... 6
4.1.5.
Self Assessment Test ............................................................................................ 9
4.1.6.
Tasks .................................................................................................................... 9
4.1.7.
Solutions ..............................................................................................................10

5.

Definition and execution of Substitution in Financial Accounting ...............................12


5.1.1.
Definition ..............................................................................................................12
5.1.2.
Business Purpose/Use..........................................................................................12
5.1.3.
Configuration considerations.................................................................................12
5.1.4.
Demonstration ......................................................................................................13
5.1.5.
Self Assessment Test. ..........................................................................................15
5.1.6.
Tasks ...................................................................................................................15
5.1.7.
Solutions ..............................................................................................................15

6.

Usage of Rules and Sets.................................................................................................19


6.1.1.
Definition ..............................................................................................................19
6.1.2.
Business Purpose / Use........................................................................................19
6.1.3.
Configuration considerations.................................................................................20
6.1.4.
Demonstration ......................................................................................................20
6.1.5.
Self Assessment Test ...........................................................................................27
6.1.6.
Tasks ...................................................................................................................27
6.1.7.
Solutions ..............................................................................................................27

Validations and Substitutions

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. Basics of Validations and Substitutions


Comparison between Validation and Substitutions: Validation is basically to validate the data
before posting the same into the books of accounts, whereas Substitution is to replace certain
values if the pre-requisites specified are met.

4. Definition and execution of Validation in Financial


Accounting
4.1.1. Definition
Balance confirmation Validation allows you to define your own individual checks for specific fields
when a business transaction is being processed.
For every company code, you can define validations for three levels. The specified levels are:
1. Document header
2. Document item
3. Complete / Entire document

Validations and Substitutions

3 of 32

4.1.2. Business use/Purpose


The validation function helps you to check the entered values and value intervals. When data are
entered in the system, the system validates the data according to the validation rules. Since data
are validated before they are actually posted, there is no scope for errors.
When you define a validation rule, the system checks the validation rule to ensure that it is
syntactically correct. You can also define the result of non-compliance with the validation rule. For
instance, you can specify that a message is issued but the user can continue processing. You
can also force the user to correct the error before processing can continue.

4.1.3. Customization Considerations


Execution of Validations in Financial Accounting.
A validation consists of three parts:

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?

Basic Steps in Configuring Validations


You must complete the following steps to create a validation:

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.

Validations and Substitutions

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 and Operators


Operands and Operators are used in building the formula. The following are some examples of
operators:

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

Parenthesis for starting a inclusive statement

Parenthesis for ending a inclusive statement

Equal to

<>

Not equal to

<=

Less than or equal to

>=

Greater than or equal to

>

Greater than

<

Less than

Validations and Substitutions

5 of 32

IN

Used to check if the fields are in a set

SUM

Total of a document

AVG

Average sum of a document

MAX

Maximum value of all line items

MIN

Minimum value of all line items

GROUP BY

Compare a group of totals with another group of totals

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

SPRO Financial accounting (New) General ledger


accounting Business Transactions GL account posting
Make and check document settings Validation in accounting
document.
GGB0

Transaction Code

Click on the Documents Header of the Financial Accounting, and Click the Validation
button

, the following screen is displayed.


Field

Value

Validation Name

YVAL

Validation Text

Validation for company code AB00

Save the entry.


Create a Step by Clicking on the Step button on the Tool Bar
Field

Value

Step No

001

Step Name

Document type not equal to SA

Tab

Prerequisite

Sub Tab

Table fields

Validations and Substitutions

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

Document Type & not allowed with standardization


entries

Message Variables

BKPF

Click the save button or CTRL + S.


After we complete the Prerequisite, Check Condition and the Message under the validation the
Screen should like below

Validations and Substitutions

7 of 32

Demo 2: Assignment of Validation step to Company code.


Menu Path

SPRO Financial Accounting Financial Accounting Global


Settings Document Line Items Define Validations for
Postings
OB28

Transaction Code

Click the New Entries button


Field

, and enter the data


Value

Company code

AB00

Call up point

001

Validation

YVAL

Activation level

01

Validations and Substitutions

8 of 32

Save and the validation is in place.


Demo 3: Validation of the transaction triggering the validation step
Menu Path

Accounting Financial Accounting General Ledger


Posting General Posting.
F-02

Transaction Code

Field

Value

Company code

AB00

Document date

Todays date

Posting Date

Todays date

Document type

SA

Posting key

40

GL account

476900

Clicks enter to see the validation error message configured in Demo 2.

4.1.5. Self Assessment Test


1. ______________ validates the data according to the validation rules.

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.

Validations and Substitutions

9 of 32

4.1.7. Solutions
Task 1:
Step 1: Creation of a validation
Menu Path

SPRO Financial accounting (New) General ledger


accounting Business Transactions GL account posting
Make and check document settings Validation in accounting
document.
GGB0

Transaction Code

Click on the Documents Header of the Financial Accounting, and Click the Validation
button

, the following screen is displayed.


Field

Value

Validation Name

VAXX

Validation Text

Validation for company code ABXX

Save the entry.


Create a Step by Clicking on the Step button on the Tool Bar
Field

Value

Step No

001

Step Name

Document type not equal to SA

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

Validations and Substitutions

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

Document Type & not allowed with standardization


entries

Message Variables

BKPF

Click the save button or CTRL + S.


Step 2: Assignment of Validation step to Company code.
Menu Path

SPRO Financial Accounting Financial Accounting Global


Settings Document Line Items Define Validations for
Postings
OB28

Transaction Code

Click the New Entries button

, and enter the data

Field

Value

Company code

ABXX

Call up point

001

Validation

VAXX

Activation level

01

Save and the validation is in place.


Step 3 : Validation of the transaction triggering the validation step
Menu Path
Transaction Code

Validations and Substitutions

Accounting Financial Accounting General Ledger


Posting General Posting.
F-02

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

Click enter to see the validation error message configured in Demo 2.

5. Definition and execution of Substitution in Financial


Accounting
5.1.1. Definition
Unlike validations that create on-screen messages to the user, substitutions actually replace and
fill in field values behind the scenes without the user's knowledge. Similar to validations,
substitutions can be setup for a number of different application areas and Callup points.
Substitutions are activated on the company code level.

5.1.2. Business Purpose/Use


The Substitutions can be used to substitute data immediately upon entry of data. It validates the
data according to a prerequisite defined by the user. If the prerequisite is met the system will
replace or substitute the values entered with other values.

5.1.3. Configuration considerations


Basic Steps in Configuring Validations
You must complete the following steps to create a substitution:

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

Validations and Substitutions

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

A substitution is activated for the combination of each of the following:

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

SPRO Financial accounting (New) General ledger


accounting Business Transactions GL account posting
Make and check document settings Substitution in accounting
document.

Transaction Code

Field

Value

Click on Environment

Substitution

Call point

001

Substitution

SUB00

Description

Substitution for Company code AB00

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

Substitution for AB00

Validations and Substitutions

13 of 32

Demo 2: Assignment of the Substitution to the company code


Menu Path

SPRO Financial accounting (New) General ledger


accounting Business Transactions GL account posting
Make and check document settings Substitution in accounting
document.

Transaction Code

Field

Value

Company code

AB00

Call up point

001

Substitution

SUB00

Activation level

01

Demo 3: Using the substitution rule in the accounting document.


Menu Path

Accounting Financial Accounting General Ledger


Posting General Posting.
F-02

Transaction Code

Field

Value

Document Date

Todays date

Type

SA

Company Code

AB00

Currency

INR

Doc Header Text

No Document Text

Posting key

40

GL Account

476900

Amount

6500

Text

Testing the Substitution

Posting key

50

GL Account

113100

Amount

6500

Validations and Substitutions

14 of 32

Value Date

Todays date

Text

Testing the Substitution

Save to post the accounting document.


The document header text which was entered at the time of posting the document should have
changed as per the substitution rule.

5.1.5. Self Assessment Test.


1. If a Pre-requisite is False, then the Substitution is activated.

True
False

2. ______________ establishes which conditions must be fulfilled before the substitution can
be performed.
Prerequisite Statement
Substitution Values
Substitution Exists
3. Call

Up Point 002 is used to activate at ______________ level.


Header Level
Line Item Level
Complete document

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

SPRO Financial accounting (New) General ledger


accounting Business Transactions GL account posting
Make and check document settings Substitution in accounting
document.

Transaction Code

Validations and Substitutions

15 of 32

Field

Value

Click on Environment

Substitution

Call point

002

Substitution

SUBXX

Description

Substitution for Company code ABXX

Click on

Step

Field
to
Substituted

be

BSEG PRCTR

Substitution method

Constant Value

Tab

Prerequisite

Formula

BKPF-BUKRS = ABXX AND BESG-HKONT = 416300

Field

BSEG-PRCTR

Constant

ABXX

Click on save to enable the substitution rule.


Step 2: Assignment of the Substitution to the company code
Menu Path

SPRO Financial accounting (New) General ledger


accounting Business Transactions GL account posting
Make and check document settings Substitution in accounting
document.

Transaction Code

Field

Value

Company code

ABXX

Call up point

002

Substitution

SUBXX

Activation level

01

The substitution rule is now active


Step 3: Using the substitution rule in the accounting document.
Menu Path
Transaction Code

Validations and Substitutions

Accounting Financial Accounting General Ledger


Posting General Posting.
F-02

16 of 32

Field

Value

Document Date

Todays date

Type

SA

Company Code

ABXX

Currency

INR

Doc Header Text

Test Substitution

Posting key

40

GL Account

416300

Amount

6500

Profit Center

Any Profit center except ABXX

Posting key

50

GL Account

113100

Amount

6500

Value Date

Todays date

Text

Testing the Substitution

Save to post the accounting document.


Based on the substitution step, the profit center is automatically taken as ABXX.
2. To create a substitution rule to ensure that when the Company code is ABXX and the GL
Account is 470001 or 416300 and the entry pertains to a vendor invoice created in finance
department, 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

SPRO Financial accounting (New) General ledger


accounting Business Transactions GL account posting
Make and check document settings Substitution in accounting
document.

Transaction Code

Validations and Substitutions

17 of 32

Field

Value

Click on Environment

Substitution

Call point

002

Substitution

SUBXX

Description

Substitution for Company code ABXX

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

Click on save to enable the substitution rule.


Step 2: Using the substitution rule in the accounting document.
Menu Path

Accounting Financial Accounting Account payable


Document entry Invoice Posting
F-43

Transaction Code

Field

Value

Document Date

Todays date

Type

KR

Company Code

ABXX

Currency

INR

Doc Header Text

Vendor Invoice

Posting key

31

GL Account

1000

Amount

5000

Validations and Substitutions

18 of 32

Posting key

40

GL Account

416300

Amount

5000

Profit Center

Any profit center except ABXX

Text

Testing the Substitution

Save to post the accounting document.


Based on the substitution step, the profit center is automatically taken as ABXX.

6. Usage of Rules and Sets


Rules and Sets are basically additional tools that are used in the creation of validation and
substitutions; they facilitate the easy creation and maintenance of validation and substitutions.

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.

6.1.2. Business Purpose / Use


Rules
A rule permits complex logic to be summarized; it can be re-used. Technically, a rule is nothing
more than, for example, a prerequisite or check of a validation.

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:

Validations and Substitutions

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:

6.1.3. Configuration considerations


Rules
If a Boolean statement is used often or if it contains complex logic, you can create a rule for this
statement. Example: a validation contains an extensive prerequisite that is also to be used in a
substitution.
Example: RULE1 AND BKPF-BLART <> 'SB'
In this example, the rule is named RULE1. When the system processes this statement, it first
processes RULE1 and then checks whether the document type is not equal to SB. The rule name
can be a maximum of 11 characters long.

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

SPRO Financial accounting (New) General ledger


accounting Business Transactions GL account posting
Make and check document settings Validation in accounting
document.
GGB0

Transaction Code

Select the Rule and click the Create Rule Button in the Menu Bar.
Field

Value

Rule Name

RULE2

Rule Description

Rule for company code AB00

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.

Validations and Substitutions

21 of 32

Demo 2: Using the Rule in the Validation step


Menu Path

Transaction Code

SPRO Financial accounting (New) General ledger


accounting Business Transactions GL account posting
Make and check document settings Validation in accounting
document.
GGB0

Assign the RULE 2 in the Validation.


The prerequisite for validation, if the company code AB00 and the Document type SA and GL
Account 220000.
Check for the Validation: Amount should not be more than Rs.1000/Select the validation YVAL created in Demo 1 and create a new Step.
Click Create Step button. In the Perquisite select Rules TAB Page and double click on YRULE1.
Select Check in the step and give the following information by selecting < button and constant
value Rs.1000/-

Validations and Substitutions

22 of 32

Field

Operator

Value

BSEG-WRBTR

<

1000

Select the Message option in Step and


Field

Value

Message Type

Message Number

025

Message Text

Amount should be less


Rs.1000 for Document

than

Click on save to activate the step

Menu Path

Accounting Financial Accounting General Ledger


Posting General Posting.
F-02

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

Testing for the validations

Press enter
An error message is displayed which is created in the Demo Step 2.

Validations and Substitutions

23 of 32

Demo 3: Example Business Scenario for Sets.


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
200000 to GL account 220999
Check: The system should not allow posting for the user xxxxxx (Current user id).
The formula for the above would be built as follows:
BKPF-BUKRS = AB00 AND BKPF-BLART = SA and BSEG-HKONT in YSET1 (Sets for
Demo)
Now create the range of the GL account as a Set.
This set could be used in more than one validation. Instead of typing the formula for each
validation step.
YSET1 = BSEG-HKONT = 200000 to 220999.
Menu Path

SPRO Financial accounting (New) General ledger


accounting Tools Sets Define Sets
GS01

Transaction Code

Field

Value

Set Name

YSET1

Tab

Basic Data

Table

BSEG

Filed Name

HKONT

From Value

200000

To Value

220999

Short Text

GL account from 200000 to 220999

Basic Set Text

Sets for Demo.

Demo 6: Using Sets in the Validation step


Menu Path

Transaction Code

Validations and Substitutions

SPRO Financial accounting (New) General ledger


accounting Business Transactions GL account posting
Make and check document settings Validation in accounting
document.
GGB0

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

Validation for set of GL accounts

Tab

Prerequisite

Sub Tab

Table Fields

Structure

Structure BKPF Accounting Document Header

Field

BKPF-BUKRS

Operator

Constant

AB00

Field

BKPF-BLART

Operator

Constant

SA

Sub Tab

Table Fields

Structure

Structure BSEG Accounting Document Line item

Field

BSEG-HKONT

Operator

IN

Set Directory

YSET1

Tab

Check

Sub Tab

Table Fields

Structure

Structure SYST ABAP system fields

Field

SYST-UNAME

Operator

<>

Constant

Your User ID

Validations and Substitutions

25 of 32

Select the Message option in Step and


Field

Value

Message Type

Message Number

031

Message Text

User & cannot post to the range of


GL account

Message
Variables

SYST-UNAME

Click on save to activate the step.


Demo 4: Set of the validation triggering the validation step
Menu Path

Accounting Financial Accounting General Ledger


Posting General Posting.
F-02

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

Testing for the validations

Press enter
An error message is displayed which is created in the Demo Step 3.

Validations and Substitutions

26 of 32

6.1.5. Self Assessment Test


1. Rules are Created only at the Line item Level

True
False

2. A rule can be used in


Validation
Substitution
Rule
Either 1 or 2.
3. Sets cannot be used in CHECK
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

SPRO Financial accounting (New) General ledger


accounting Business Transactions GL account posting
Make and check document settings Validation in accounting
document.
GGB0

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

Rule for company code ABXX

Validations and Substitutions

27 of 32

Save the entry.


Select Rule Definition, select Structure BKPF and enter the following

Field

Value

Rule Definition
TAB

Table Fields

Structure

BKPF Accounting Document Header

Field

BKPF-BUKRS

Operator

Constant

ABXX

Operator

AND

Field

BKPF-BLART

Operator

Constant

DA

TAB

Table fields

Structure

SYST ABAP System Fields

Field

SYST-UNAME

Operator

Constant

Your User ID

Save the Rule.


Select the validation rule already created VAXX and
Click the Create Step Button

Field

Value

Step No

XXX

Step Name

Document Date Less than 25.12.2009

Tab

Prerequisite

Validations and Substitutions

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

Click the save button or CTRL + S.


Step 3 : Checking the validation step in a transaction
Menu Path

Accounting Financial Accounting General Ledger


Posting General Posting.
F-02

Transaction Code

Field

Value

Company code

ABXX

Document date

Todays date

Posting Date

Todays date

Document type

DA

Posting key

40

GL account

476900

Validations and Substitutions

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

SPRO Financial accounting (New) General ledger


accounting Tools Sets Define Sets
GS01

Field

Value

Set Name

YSETXX

Tab

Basic Data

Table

BKPF Click enter

Filed Name

BUKRS

From Value

AB00

To Value

AB99

Short Text

Company Code AB00 to AB99

Basic Set Text

Sets for Demo.

Step 2: Using Sets in the Validation step


Menu Path

Transaction Code

SPRO Financial accounting (New) General ledger


accounting Business Transactions GL account posting
Make and check document settings Validation in accounting
document.
GGB0

Select the validation rule VAXX and Click Create Step button
Field

Value

Validation Step

XXX

Validation Description

Validations for Sets for company code

Tab

Prerequisite

Sub Tab

Table Fields

Structure

Structure BKPF Accounting Document Header

Validations and Substitutions

30 of 32

Field

BKPF-BUKRS

Operator

IN

Set Directory

YSETXX

Operator

AND

Structure

Structure SYST - ABAP System Fields

Field

SYST-UNAME

Operator

Constant

Current user ID

Tab

Check

Sub Tab

Table Fields

Structure

Structure BKPF Accounting Document Header

Field

BKPF-BLART

Operator

<>

Field

KA

Select the Message option in Step and


Field

Value

Message Type

Message Number

3XX

Message Text

User & is not Authorized to post in


this company code, document type
KA

Message
Variables

SYST-UNAME

Step 2: Testing the validation in the transaction


Menu Path
Transaction Code

Validations and Substitutions

Accounting Financial Accounting General Ledger


Posting General Posting.
F-02

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

Testing for the validations

Press enter
An error message is displayed which is created in the above step.

Validations and Substitutions

32 of 32

You might also like