SAP Finance Validations

Table of Contents

Validation in Accounting document

  • Validations are custom rules to check that FI data entered is correct
  • Validations are defined at company code level
  • Validations can be set at Document header level, Line item level and whole document level.
  • Only one validation per company code can be defined at a call up point. However each validation can have multiple steps
  • Transaction code : OB28
  • Transaction code to maintain validation sets: GS02
Call up Points Behavior Tables
001- Header Level Only header fields can be accessed BKPF
002- Line item level Header and single item fields can be accessed BKPF and BSEG
003- Complete Document level Access to all header and line item fields BKPF and BSEG

Each validation step consists of these 3 main points

Validation steps
Validation steps

Example : Let us create a Validation that posting to GL Accounts #400300, 400200, 400100

Require an entry in field Trading Partner. If no Trading Partner, system give an error message “Please Provide Trading Partner”

We create a SET for GL Account # 400300, 400200, 400100. This way we don’t have to specify the GL accounts in the validations. We can just enter the SET in the validation

Create SET transaction Code : GS01

In the field Table enter : BSEG-HKONT

Create SET
Create SET

 

Create Validation for FI document

Transaction Code : OB28

IMG Path : SPRO – Financial Accounting – Financial accounting global settings – Document – Document Header – Validations in Accounting Document

Click new entries and enter the below details:

Create SAP Validation

Select row, double click and create the validation as below:

Click Validation button and enter below details

Create SAP Validation

Select Folder and click button STEP.

Click Prerequisite (Funnel). Enter the conditions, which if True, Validations gets triggered

Prerequisite is “ When Company code is MK14 and GL account is in SET (GLACCOUNT), validation should be triggered

Create Validation Prerequisite

Now Click Check. Here enter the condition which Validation should check. We want it to verify that GL account in the SET have Trading Partner during document entry

Check Validation

Now click the last step Message. Here enter the Message number which should be displayed by the validation

Create validation message

Click Save button to Save the Validation

Now to Transport the Validation from SAP Development system to SAP Quality system, select the validation. Click Validation button -> Click Transport and save the Validation.

Validation transport

 

Test the FI Validation

Enter Vendor Invoice. Transaction Code FB60

Validation testing

 

Substitution in SAP

What is the substitution

The substitution function can be used to substitute a value to some fields which is included in line item table BSEG or header table BKPF. And the substitutions are valid for both the manual entry of documents and the automatic created entry of documents (for example, payment program).

You can define a substitution via call points (0001 is for substitution in document header level; 0002 is for substitution in document line item level; 0003 is a substitution for a complete document).

The following example explain how to define a substitution by using constant value.

Example: substitute a constant value “XXXX” into BSEG-SGTXT (Text) field in company code 1000.

 

Creating Finance Substitution in SAP

Transaction code: OBBH

IMG Path : SPRO – Financial Accounting – Financial accounting global settings – Document – Document Header – Substitutions in Accounting Document

Create an entry in call point 2, then double click this entry. 

Create Substitutions

Press Substitution button, enter the substitution name in substitution field, press enter, then the ‘TEXT’ is listed under node ‘line items’ in the left Substitutions area as follow: 

Create Substitution

Press step button, then tick the field into which you want to substitute a value(for this example is BSEG- SGTXT).

Substitution field

Press enter, then select the radio button of “Constant value” if you want to substitute a value into a field, or select the radio button of “EXIT” if you want to substitute a value by a User Exit.

Substitution Method

Press “Prerequisite” in the left side under ‘TEXT’ for defining when this substitution works. For this example define a substitution which work when company code = ‘1000’ and user name is EHPUSER478

Substitution Prerequisite

Enter the perquisite as shown below. User name field can be found in Structure Syst. Double click it. Now double click SYST-UNAME to enter it in perquisite screen. Select the operator =. Click the constant button and enter constant value EHPUSER478. Now click structure BKPF. Select field BKPF-BUKRS. Enter the company code’1000’ in the constant.

Substitution conditions

Press ‘Substitution’ in the left side under substitution ‘TEXT’’, define a constant value as “ZZZZ” in text field (BSEG-SGTXT), then save it:

Substitution value

Activate this substitution in Tcode OBBH with value ‘1’ (‘0’ means Inactive; ‘1’ means Active; ‘2’ means Batch input processing): 

Activate Substitution

 

Testing the substitution in SAP

Post an FI document in transaction F-02 and verify whether Text field is populated with ‘ZZZZ’

Test Substitution

Please note if the substitution is not working, regenerate the substitution in the program# RGUGBR02. For this go to transaction code SE38. Enter the program# RGUGBR02 and execute

This completes our discussion on validation and substitution in SAP Finance

For detailed, step-by-step instructions on SAP Finance, business process, configuration and development follow along with my video tutorial below : SAP Finance & Controlling Course

4 thoughts on “SAP Finance Validations”

  1. Pingback: SAP Finance Enterprise Structure | SAP FINANCE and Treasury

  2. Pingback: SAP Finance Substitutions |

  3. Pingback: SAP Finance Tutorials | AUMTECH Solutions-SAP Training

  4. Pingback: SAP FICO Interview Questions & Answers | AUMTECH Solutions-SAP Training

Leave a Comment

Your email address will not be published. Required fields are marked *

error: Content is protected !!