You are on page 1of 31

GL account Validation and Substitution1

GL range 1001001 -

I. Introduction2
The validation and substitution tools can be used to validate and substitute data immediately upon
entry.

For example:

1. During document entry only a valid combination of GL account and business area needs to be
entered. This can be set as a validation in the system.

2. Providing the profit center contents using a certain combinations of expense accounts, company
code and business partner. This can be set as a substitution in the system.

Operator Definition

< Less than

> Greater than

<> Not equal to

= Equal to

<= Less than or equal to

>= Greater than or equal to

Symbol Operation

+ Addition

- Subtraction

* Multiplication

1
https://www.youtube.com/watch?v=xGrz_pfx0oc
2
https://www.gotothings.com/fico/validation-and-substitution-in-sap-fico.htm
/ Division

II. Definition and Execution of Validation and Substitution.


1. Validation- The validation function checks the entered values and value intervals. When data
are entered in the system, the rule manager validates the data according to the validation rules.
Since data are validated before they are actually posted, only validated data is accepted.

2. Substitution- In Substitution, the values entered into the SAP system are validated according to
a prerequisite defined by the user. If the prerequisite is met the system replaces the value entered
with other values.

1. Pages
2. …
3.  Special Purpose Ledger

Skip to end of banner


Go to start of banner

Validation and Substitution


Skip to end of metadata
 Created by Emily Ji, last modified by TAMAS VARGA on Nov 13, 2017

Go to start of metadata

Difference between Validation and Substitution


Validation
-          validation will check values or value intervals entered by the user

-          built-in help: check function is available to ensure the validation is logically correct

-          output will be either a warning message (this message can be ignored) or an error
message

Substitution
-          values or value intervals are validated according to certain conditions (prerequisits)
defined

-          in case the conditition is met during the program run a replacement will happen

-          output will be a replacement of values or intervals

Steps of creating a validation / substitution:


1)      APPLICATION                                        where ?

2)      CALLUP-POINT                                      when ?

3)      DEFINITION                                            what and how ?

4)      RELATION                                              organizational unit

5)      ACTIVATION                                          active ?

First step is to define which application should use validation / substitution (where?) The
following applications use the VSR-Tool and this makes this tool a cross-application-tool:

-          AM    Asset Management          

-          CO    Controlling               

-          CS    EC-CS Consolidation       

-          FI      Financial accounting      

-          SL    Special Purpose Ledger    

-          LC    Consolidation             

-          PS    Project system            

-          RE    Real Estate

Second step is to define when exactly a validation / substitution is happening. In tr. GB31 you can
check the combinations of Callup-Points and Applications. Each combination builds a so-called
Boolean-Class. In table GB31, you will also find the information, if substitutions or validations are
possible for a certain Boolean-Class. Some examples:
Appl Callup Bool Val. Sub. Descr.
.

FI 1 8 x x Document Header

FI 2 9 x x Document Line

FI 3 15 x x Complete Document

Third step is the most complex: define the validation / substitution itself. (what to do and how to
do)

Forth step to assign the validation /substition to an appropriate org unit e.g. company code.

Last step is to activate the program.

Validation
Many values that you enter into the SAP R/3 System e.g. in tr. fb60  are automatically checked
against standard validation rules.
eg. document date, posting period opened, existing company code

These validations are R/3 checks not Customer defined. These are standardized, however,
Customer specific validations cannot be standarized. FI-SL*provides a wide range of solution
approches to create customer validations. FI-SL validations allow you to create your own Boolean
statements without making any changes to the standard system.

Validation Structure
 Each validation step consists of these 3 main points:

Callup points
Validation/substitution callup points are specific places in an application, which specify the exact
location where a validation/substitution occurs.

At each callup point, the system can use information you have already entered (such as a user
name, header information, and information entered in previous callup points) to
validate/substitute the values you enter at a callup point.

At callup point (1) only those fields above and the system fields can be used for validation.
Exception: Document number, Cross-CC no. are blank when they are created automatically by the
system at the end of the process.

Boolean class
Boolean class is a technical term, which determines the fields that can be used in a
validation/substitution/rule definition, as well as the message class for validation messages  (see
table GB31 and GB01).

GGB0: Define Validation

GGB4: Activate Validation

GCT9: Transport Validation

When defining a validation in tr. GGB0 the R/3 system generates coding according to validation
definition.

Pools for generated Coding:

GBTccaa0                   Mainprogram             

GBTccaaD                   Validation                  

GBTccaaE                    Prerequisites             

GBTccaaF                    Checks          

cc =  encoded client (SE37: G_CLIENT_ENCODE, G_CLIENT_DECODE)

aa =  Application Area

Example:

As stated above the validation step consists of 3 points:

The validation ensures that postings only with Document type (Belegart) 'SA' can be performed in
Company Code VATO. In case the Document type is different an error message appears and no
posting can be carried out.
 

In transaction FB01 the two different outcome of the validation can be realized
In case you would like to analyse it coding side:

You can use „=SHCE“ and „=SHCF“ in the command field while you are on the validation step:
The command will bring you to coding part of „Prerequisite“

The other command will bring you to coding part of „Check“


Breakpoints can be activatedhere and the debugging procedure can be started. However, R/3
system offers a trace function. You can use the Extras => Switch on total trace function from the
Menu. A tracing function allows to test a validation/substitution/rule definition during the
posting process. While posting a document, the system will call the validation/substitution/rule
and display the rule contents, as well as how the data is used for validation or substitution. This
function allows you to diagnose possible errors in the validation/substitution/rule definition.
Further information can be found in KBA 1589540.

Substitution
A substitution is the checking process of entered values against a user-defined Boolean
statement. If the statement is true, the system substitutes specified values into the system.
Important to mention that the system performs substitutions before validations so that
substituted values can also be validated.
Process of a Substitution definition

Fields released for substitution


Tables GB01 and GB01C determine which fields can be used for a specific Boolean class. Table
GB01 is a client-independent, control table delivered with the SAP R/3 System and cannot be
changed; table GB01C is client-dependent and is provided specifically for customer configuration.
Only fields having blank in field BEXCLUDE are substitutable. Nevertheless some critical fields
may be overwritten by other components after the substitution (for example: profit center field).
Customer can modify, however, removing the BEXCLUDE-Flag in GB01 is formally
modification! note 42615
Create / Change Substitution
Pools for generated Coding

GBTccaa0 Mainprogram               (Enter „=SHC0“ in command field)

GBTccaaB Substitution               (Enter „=SHCD“ in command field)

GBTccaaC Prerequisites               (Enter „=SHCE“ in command field)

cc =  encoded client (SE37: G_CLIENT_ENCODE, G_CLIENT_DECODE

aa =  Application Area

 Example
A subsitution was created with the below settings: 

 In transaction FB01 the document header is empty:


After the posting process in the header, posting date is visible:

In transaction SE37 with the entering of Function Module G_VSR_SUBSTITUTION_CALL /


G_VSR_MULTI_SUBSTITUTION_CALL, all of the substitutions can be checked on coding level. (It's
worth to put the breakpoint at the beginning of the function module)

As in case of Validations the trace function is also available here. Further information can be
found in KBA 1589540.
User Exit
User exits are user-defined FORM routines, which are used to calculate and/or replace values
within a validation, substitution, or rule.

User exits have the following format: Uxyz, for example: U100

User Exits are stored in Formpools. The name of the Formpool is customized in table T80d
(transaction GCX2)

In transaction SE38  a copy of template of RGGBR000 (Length: 8 Characters Client dependent)


can be performed into e.g. ZGGBR000
User exit definitions:
Customer Includes (zgbbgd00) may cause problems, here any modification is strictly prohibited.

Validation and Substitution in S4 Hana


In case you would like to have information about how this functionality works in S4 Hana
environment, please see note 2462725.

Validation and Substitution in the system is carried in the following


manner:
Application (Where) -> Callup point (When) -> Definition (What) -> Allocation (Organizational Unit) ->
Activation (Active)

Each of the above steps will be explained as below:

A). Decide upon the area of application - Application area is where the validation or substitution rule
is used.

The following application areas use validations and substitutions:

FI financial accounting,

CO cost accounting,

AM asset accounting,

GL special purpose ledger,

CS consolidation,

PS project system,

RE real estate,

PC profit center accounting,

GA allocations.

Each application defines the structures available and releases its fields for substitution.

B). Select the call up points – These are specific places in an application that specify the exact
location where a validation or substitution occurs.

Three call up points have been provided for FI

1. Document header - Validation and substitution at document header level

2. Document line item - Validation and substitution at document line item level

3. Complete document - Validation and substitution of the whole document


C). Defining validation/substitution – Using operands, logical operators and comparison operators,
the rules for the prerequisites and checks can be defined.

D). Assignment and Activation – You must assign your validation and substitution to an appropriate
organization unit (e.g. company code for FI).A validation/substitution can be valid for several
company codes at the same time.

Furthermore the validation/substitution for the correct call up point must be activated.

The following degrees of activation exist for the organizational unit (e.g. company code) + call up
point + substitution (or validation) combination:

0 Inactive

1 Active for dialog and batch

2 Active except for batch input

III. Understanding validation and substitution in FICO using illustrations

A). Validation in accounting documents

IMG Path - SAP Reference IMG -> Financial Accounting -> General Ledger Accounting -> Business
Transaction -> GL account posting -> Carry out and check document setting -> Validation in
accounting document

Transaction: OB28

Case:

Management has decided that car rent paid shall not exceed 10000 USD per document.

Hence the company has decided that maximum line item amount for Car Rent GL a/c will be less
than USD 1000.

Validation rule for this will be set at the line item level as follows:

1. Using transaction OB28, go to “Change view validation of accounting documents”

Select the company code in which validation rule is to be set or if new company code is to be added
then select the “New Entry” tab.

2. Double click on the selected company code

3. Select the Call Up Point at which the validation is to be set.


4. Since the rent expense amount should not exceed USD 1000, we will set the validation rule at the
document line item level.

5. Select the arrow for line item and select the validation step relevant to your company code

6. Select the “Insert step” tab for creation of new validation rule. A new step 008 will get added up.
Now click on Prerequisite.

7. As shown above there are three table structure given.

8. We have to select that table which contains the field for which validation rule needs to be set.
We need GL account and amount field which are present in the table structure BSEG.

9. Double click on BSEG and select the field.

Double click on the BSEG-HKONT field and then “=” sign followed by clicking the constant and then
enter the GL A/c number therein.

10. Click on the “Check” tab and select the WRBTR field with respect to line item amount in table
BSEG and then specify the condition “Amount<=10000

11. Now select the “Message” and enter the message which should be displayed in case the
document amount exceeds USD 1000.

Save the above created validation rule and post a document with amount greater than amount
USD1000.

An error message specified will be displayed because of the validation defined.

In a similar way validation can be defined at Document Header Level and at the overall document
level.

B). Substitution in accounting documents

IMG Path: IMG* Financial Accounting * General Ledger Accounting * Business Transactions * GL
Account Posting * Carry out and check document settings * Substitution in Accounting Documents

Transaction: OBBH

Case:

Accounting department wants that for a combination of GL a/c 260671000 and transaction code
FB60 (Vendor Invoices), profit center should be 1241 only.

Hence using substitution profit center can be substituted for the specified combination.

1. Using transaction OBBH, go to “Substitution in Accounting Documents”

2. Select the company code in which validation rule is to be set or if new company code is to be
added then select the “New Entry” tab.
3. In general substitution rule is present at document header, line item and at complete document
level.

4. Since in this case the GL account and transaction code combination is needed, hence we will select
the line item level and then select the down arrow for it.

5. User can create his own substitution or can add a step in the already existing substitution.

6. Create a new substitution step by clicking on the “Insert Tab” button.

7. Select the field to be substituted as shown below:

8. Give the description and select the table structure from which the field needs to be specified in
prerequisite.

9. Currently we need to specify GL account (BSEG-HKONT) and transaction code (SYST-TCODE) and
select the AND operator since both the conditions are needed to be fulfilled.

10. Specify the profit center in the substitutions tab

11. Remember to activate by selecting “1” as activation level.

12. Save the substitution rule and post an entry using transaction FB60 and GL a/c 260671000, and
the profit center 1241 will get automatically substituted.

IV. Conclusion
In this manner, validation and substitution rules can be set up with respect to business transactional
requirements.

Validation and substitution are useful in every aspect whether it is GL accounting or cost accounting.

Business rules can be set up at line item level, header level or at the whole of FI document level
making it one of the most useful tools with SAP consultants.
Validation
Save and double click on entry

Window will pop-up

Click on Validation
Name it

Click on steps

Click on prerequisite
Now search for text
Now click on messages

You can edit text


Save

Back

Select validation and activation level “Active” and save

For validation check go for T Code F-02 (Enter GL account Posting)


Substitution

T-code: OBYC see integration between MM and FICO

All are check in pTCL settings except Account-assigned purchase order;

We have assigned one GL for on group of material, but for posting we need two GLs for record
material as well as penalty cost, so we need substitution

TCode: CO01 to create production order (to issue stock to production order)

TCode: SE16 to check same entry for above will give below

screen
Step for substitution3

Example: Prerequisites:

BSEG-BUKRS = '1100' AND SYST-TCODE = 'MIR7' AND


BSEG-BSCHL = '50'
AND BSEG-SGTXT = ''
OR BSEG-BUKRS = '1100' AND SYST-TCODE = 'MIR7' AND
BSEG-BSCHL = '40'
AND BSEG-SGTXT = ''

3
https://www.youtube.com/watch?v=G0NmjbzTNn0
Substitute with header text : BKPF-BKTXT

If in substitution you want to add field. G to SM30 and open table

Tcode: SE38

Program Name: RGUGBR00

Mark Check to all fields and “Execute” lam


Filed checked in table are excluded from substitution
SE11
Header Line text

Table Name: INVFO

Field Name: SGTXT

In line item

Table anme: ACGL_ITEM

Field name: SGTXT

G/L

Table name: ACGL_ITEM

Field HKONT

You might also like