Top Banner
Validation rules in FI In the SAP R/3 System, nearly all input values are validated by a program or against tables or master files. Since some types of validations cannot be standardized, you can use the validations program to create validations for your specific requirements. The validation function enables you to check values and ranges of values as they are being entered in the SAP R/3 System. Validation rules are stored in the Rule Manager. As data is entered into the system, the Integration Manager validates the data against the validation rules. Because data is validated before it is actually posted, only valid information is posted to the FI-SL application component. The system validates account numbers against a master file or checks that a ledger is assigned to a local company code. You use validations when you want to create a user-defined Boolean statement to validate an entry in a way that is not defined for the standard system. A validation can consist of up to 999 steps. You can therefore validate data against any number of Boolean statements before the data is posted. Creating a Validation: 1. Go to transaction GGB0 and select the application area-Financial accounting from the tree menu. Select the node: Line item. Click on the “Validation” button available on the application toolbar to create the validation and enter the following details: Validation name: VB15_V2 Description: Validation for the tax code Message ID: ZFGL Call up Point: 2 Application area: FI Click on ‘Save’.
15

Validation and Substitution in SAP

Feb 09, 2016

Download

Documents

indusekar83

Validation and Substitution in SAP
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Validation and Substitution in SAP

Validation rules in FIIn the SAP R/3 System, nearly all input values are validated by a program or against tables or master files. Since some types of validations cannot be standardized, you can use the validations program to create validations for your specific requirements.

The validation function enables you to check values and ranges of values as they are being entered in the SAP R/3 System. Validation rules are stored in the Rule Manager. As data is entered into the system, the Integration Manager validates the data against the validation rules. Because data is validated before it is actually posted, only valid information is posted to the FI-SL application component.

The system validates account numbers against a master file or checks that a ledger is assigned to a local company code.

You use validations when you want to create a user-defined Boolean statement to validate an entry in a way that is not defined for the standard system.

A validation can consist of up to 999 steps. You can therefore validate data against any number of Boolean statements before the data is posted.

Creating a Validation:

1.       Go to transaction GGB0 and select the application area-Financial accounting from the tree menu. Select the node: Line item.

Click on the “Validation” button available on the application toolbar to create the validation and enter the following details:

Validation name: VB15_V2

Description: Validation for the tax code

Message ID: ZFGL

Call up Point: 2

Application area: FI

Click on ‘Save’.

Page 2: Validation and Substitution in SAP

Note: Validations can be created for all the application areas of FI available on the screen of GGB0 as shown above.

Page 3: Validation and Substitution in SAP

2.       Now click on “Step” button on the application toolbar to create the validation step with the below details:

In the “prerequisites” sub node enter the below condition:  (This validation rule should trigger only for transaction FB01,FB60,FB65,FB02,MIRO,FV60,FV65,FVB0,FBM2,FBV0,FBV2,F-01,F-44,and only for vendor line items(KOART= ‘K’)

(BKPF-TCODE = 'FB01' OR BKPF-TCODE = 'FB60' OR

 BKPF-TCODE = 'FB65' OR BKPF-TCODE = ‘MIRO’ OR

 BKPF-TCODE = 'FB02' OR BKPF-TCODE = 'FBM2' OR

BKPF-TCODE = 'FBV0' OR BKPF-TCODE = 'FBV2' OR

BKPF-TCODE = 'FV60' OR BKPF-TCODE = 'FV65' OR

BKPF-TCODE = 'F-01' OR BKPF-TCODE = 'F-44’) AND

(BSEG-KOART = ‘K’)

Page 4: Validation and Substitution in SAP

3.    In the “message” sub node, enter the details of the error message that needs to be displayed.

4.       Go to transaction OB28 to activate the Validation, Click on new entries and enter the following details and save:

CoCd (Company code) = VB15.

CallPnt = 0002 (Line Item).

Page 5: Validation and Substitution in SAP

Validation = VB15_V2

Activtn level = 1(Active).

Now Test if the validation created will trigger. Go to Transaction FB01 and try to create a vendor credit memo(With One vendor Line item: Posting Key : 21)

5.                   Since we have created a validation rule to trigger for company code: VB15 and only for the vendor Line item (KOART = K), the error message is displayed as below.

Page 6: Validation and Substitution in SAP

Defining Substitution RuleBased on some Conditions when a value needs to be filled in some field dynamically we go for Substitutions. SAP provides Substitutions for FI module.

Execute GGB1 to define Substitution Rules.

Select Line Item and Create Substitution. (Line Item is selected because the partner bank type belongs to Line Item i.e., BSEG and the field name of Partner Bank type is BVTYP) .

Page 7: Validation and Substitution in SAP

   

Give necessary Description for the Substitution and Create a Step as shown below. 

 

Select Appropriate Field, where the Value needs to get substituted.

 

Once the Continue Button is clicked the following Screen appears. Specify the type of Substitution. User Exit is chosen when coding needs to be done i.e., Value needs to be derived based on some Logic.

Specify the Prerequisites i.e., only when the prerequisites are met the Substitution will work else it will skip.

Page 8: Validation and Substitution in SAP

 

Specify the User Exit Form name in the below screen.

 

Defining User Exit for Substitution

Page 9: Validation and Substitution in SAP

Now the following section explains how to create the User Exit name.

The program ZRGGBS000 should be copied from RGGBS000.

 

Enter the Following code in the form GET_EXIT_TITLES.

  DELETE exits WHERE name  = 'UFP04'.  exits-name  = 'UFP04'.  exits-param = c_exit_param_field.  exits-title = text-prb.  APPEND exits.

Write the Above piece of code before the statement   REFRESH etab.

Here UFP04 is the User Exit name (can give any Name).

Page 10: Validation and Substitution in SAP

 

In the above Report, the Following code also needs to be entered.

The Form name should be the User Exit name that was declared above.

As the Value gets substituted to the field BSEG-BVTYP we should have the exporting field suffixed by 'E_' i.e., E_BVTYP as shown below.

Page 11: Validation and Substitution in SAP

Next Settings should be done in OBBH for this Substitution as shown below:

Testing & SolutionNow let us test this Substitution via FB60.

 

Mandatory Fields Vendor Number, Invoice Date, Reference and Currency needs to be entered.Then Select the Payment Tab to see if the Value for Partner Bank Type gets substituted.

But you can notice that Partner Bank Type has not been derived in the below screen.

   

The Reason is "Sometimes for the Substitution to work, all the necessary fields (not only Mandatory Fields, other Fields as well) should be entered with Values".

Page 12: Validation and Substitution in SAP

In the Above Screen the Substitution was not called as the Amount field was Empty.In the below Screen the Amount field is entered, so the Partner Bank type value is substituted automatically.

Page 13: Validation and Substitution in SAP