4 8_Validation and Substitution

download 4 8_Validation and Substitution

of 32

Transcript of 4 8_Validation and Substitution

  • 8/10/2019 4 8_Validation and Substitution

    1/32

    Validations and Substitutions 1 of 32

    444___FFFiiinnn aaa nnn ccc iiiaaa lll AAAccc ccc ooo uuu nnn ttt iiinnn ggg ___GGGLLL///AAARRR///AAAPPP 444...888___ VVVaaa llliiiddd aaa ttt iiiooo nnn aaa nnn ddd SSS uuu bbb sss ttt iiitttuuu ttt iiiooo nnn

  • 8/10/2019 4 8_Validation and Substitution

    2/32

    Validations and Substitutions 2 of 32

    CCCooo nnn ttteee nnn tttsss 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

  • 8/10/2019 4 8_Validation and Substitution

    3/32

    Validations and Substitutions 3 of 32

    CCCooo uuu rrrsss eee OOOvvveee rrrvvv iiieee www This training document covers the Validations and Substitutions, its definition, use andmanagement. It also explains the configurations and demonstrations on Validations andSubstitutions.

    1. Topics Covered

    After study of this document participants would be able to explain:

    1. Execution of validation and substitution2. Basics of creating a validation and a substitution3. Validation and substitution maintenance

    2. Business Scenario

    The head accountant of ABC International is concerned about the number of data entry mistakesthat take place in accounting the transactions. It is required to ensure that certain basic validationhas to been done before the document is posted in the system.

    Following paragraphs of this course material takes us through the various process of usingvalidations and substitutions for concerns raised by the Head accountant of ABC ShippingCorporation.

    3. Basics of Validations and Substitutions

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

    4. Definition and execution of Validation in FinancialAccounting

    4.1.1. Definition

    Balance confirmation Validation allows you to define your own individual checks for specific fieldswhen a business transaction is being processed.

    For every company code, you can define validations for three levels. The specified levels are:

    1. Document header2. Document item3. Complete / Entire document

  • 8/10/2019 4 8_Validation and Substitution

    4/32

    Validations and Substitutions 4 of 32

    4.1.2. Business use/Purpose

    The validation function helps you to check the entered values and value intervals. When data areentered in the system, the system validates the data according to the validation rules. Since dataare 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 issyntactically correct. You can also define the result of non-compliance with the validation rule. Forinstance, you can specify that a message is issued but the user can continue processing. Youcan 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 thevalidation 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 Accountingor in Controlling etc.

    Select the correct Call up point for the validation e.g. at the header level or the line itemlevel 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 applicationarea 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 logicalexpressions.

    Depending on the context for the formulation required, you are given buttons to press whichprovide 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.

  • 8/10/2019 4 8_Validation and Substitution

    5/32

    Validations and Substitutions 5 of 32

    Depending on the entries the system will only allow to dispose of the correct logical formulation toguarantee 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 stillsupported, but here the options that can used are delivered using press buttons and texts. Thisenhances 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 thevalidation. 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 ofoperators:

    Operands /Operators

    Description

    AND Used to check more than one condition and the result must be true for

    both for the system to proceedOR 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

    = Greater than or equal to

    > Greater than

    < Less than

  • 8/10/2019 4 8_Validation and Substitution

    6/32

    Validations and Substitutions 6 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 systemshould throw an error message.

    Menu Path SPRO Financial accounting (New) General ledgeraccounting Business Transactions GL account posting Make and check document settings Validation in accountingdocument.

    Transaction Code GGB0

    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

  • 8/10/2019 4 8_Validation and Substitution

    7/32

  • 8/10/2019 4 8_Validation and Substitution

    8/32

    Validations and Substitutions 8 of 32

    Demo 2: Assignment of Validation step to Company code.

    Menu Path SPRO Financial Accounting Financial Accounting GlobalSettings Document Line Items Define Validations forPostings

    Transaction Code OB28

    Click the New Entries button , and enter the data

    Field Value

    Company code AB00

    Call up point 001

    Validation YVAL

    Activation level 01

  • 8/10/2019 4 8_Validation and Substitution

    9/32

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

    Transaction Code F-02

    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 Test1. ______________ 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 beingprocessed.

    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 systemshould throw an error message.

  • 8/10/2019 4 8_Validation and Substitution

    10/32

    Validations and Substitutions 10 of 32

    4.1.7. SolutionsTask 1:

    Step 1: Creation of a validation

    Menu Path SPRO Financial accounting (New) General ledgeraccounting Business Transactions GL account posting Make and check document settings Validation in accountingdocument.

    Transaction Code GGB0

    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

  • 8/10/2019 4 8_Validation and Substitution

    11/32

    Validations and Substitutions 11 of 32

    Sub Tab Table Fields

    Table Structure BKPF

    Field BKPF BLART

    Operator

    Constant SA

    Tab Message

    Message Type E

    Message Class Z1

    Message Number 1XX

    Message Text Document Type & not allowed with standardizationentries

    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 GlobalSettings Document Line Items Define Validations forPostings

    Transaction Code OB28

    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 Accounting Financial Accounting General Ledger Posting General Posting.

    Transaction Code F-02

  • 8/10/2019 4 8_Validation and Substitution

    12/32

    Validations and Substitutions 12 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 FinancialAccounting

    5.1.1. Definition

    Unlike validations that create on-screen messages to the user, substitutions actually replace andfill 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 thedata according to a prerequisite defined by the user. If the prerequisite is met the system willreplace 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 accountingor 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).

  • 8/10/2019 4 8_Validation and Substitution

    13/32

  • 8/10/2019 4 8_Validation and Substitution

    14/32

    Validations and Substitutions 14 of 32

    Demo 2: Assignment of the Substitution to the company code

    Menu Path SPRO Financial accounting (New) General ledgeraccounting Business Transactions GL account posting Make and check document settings Substitution in accountingdocument.

    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.

    Transaction Code F-02

    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

  • 8/10/2019 4 8_Validation and Substitution

    15/32

    Validations and Substitutions 15 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 havechanged 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 canbe 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 theGeneral 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 entrypertain 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 theGeneral ledger account is 416300, then the profit center should be ABXX, please go to thefollowing node:Step 1: Create a new substitution rule as per the following details

    Menu Path SPRO Financial accounting (New) General ledgeraccounting Business Transactions GL account posting Make and check document settings Substitution in accountingdocument.

    Transaction Code

  • 8/10/2019 4 8_Validation and Substitution

    16/32

    Validations and Substitutions 16 of 32

    Field Value

    Click on Environment Substitution

    Call point 002

    Substitution SUBXX

    Description Substitution for Company code ABXX

    Click on Step

    Field to beSubstituted

    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 ledgeraccounting Business Transactions GL account posting

    Make and check document settings

    Substitution in accountingdocument.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 Accounting Financial Accounting General Ledger Posting General Posting.

    Transaction Code F-02

  • 8/10/2019 4 8_Validation and Substitution

    17/32

    Validations and Substitutions 17 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 GLAccount is 470001 or 416300 and the entry pertains to a vendor invoice created in financedepartment, 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 ledgeraccounting Business Transactions GL account posting

    Make and check document settings

    Substitution in accountingdocument.Transaction Code

  • 8/10/2019 4 8_Validation and Substitution

    18/32

    Validations and Substitutions 18 of 32

    Field Value

    Click on Environment Substitution

    Call point 002

    Substitution SUBXX

    Description Substitution for Company code ABXX

    Click on Step

    Field to beSubstituted

    BSEG PRCTR

    Substitution method Constant Value

    Tab Prerequisite

    Formula BKPF-BUKRS = ABXX AND ( BESG-HKONT = 416300 OR BSEG-HKONT =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 PostingTransaction Code F-43

    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

  • 8/10/2019 4 8_Validation and Substitution

    19/32

  • 8/10/2019 4 8_Validation and Substitution

    20/32

  • 8/10/2019 4 8_Validation and Substitution

    21/32

    Validations and Substitutions 21 of 32

    Menu Path SPRO Financial accounting (New) General ledgeraccounting Business Transactions GL account posting Make and check document settings Validation in accountingdocument.

    Transaction Code GGB0

    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 DocumentHeader 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 RuleScreen should look like below.

  • 8/10/2019 4 8_Validation and Substitution

    22/32

    Validations and Substitutions 22 of 32

    Demo 2: Using the Rule in the Validation step

    Menu Path SPRO Financial accounting (New) General ledgeraccounting Business Transactions GL account posting Make and check document settings Validation in accounting

    document.Transaction Code GGB0

    Assign the RULE 2 in the Validation.

    The prerequisite for validation, if the company code AB00 and the Document type SA and GLAccount 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 constantvalue Rs.1000/-

  • 8/10/2019 4 8_Validation and Substitution

    23/32

    Validations and Substitutions 23 of 32

    Field Operator Value

    BSEG-WRBTR < 1000

    Select the Message option in Step and

    Field Value

    Message Type E

    Message Number 025

    Message Text Amount should be less thanRs.1000 for Document

    Click on save to activate the step

    Menu Path Accounting Financial Accounting General Ledger Posting General Posting.

    Transaction Code F-02

    Field Value

    Company code AB00

    Document date Todays datePosting Date Todays date

    Document type SA

    Posting key 40

    GL account 220000

    Amount 2000

    Value Date Todays Date

    Text Testing for the validations

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

  • 8/10/2019 4 8_Validation and Substitution

    24/32

    Validations and Substitutions 24 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 is200000 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 forDemo)

    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 eachvalidation step.

    YSET1 =BSEG-HKONT =200000 to 220999.

    Menu Path SPRO Financial accounting (New) General ledgeraccounting Tools Sets Define Sets

    Transaction Code GS01

    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 SPRO Financial accounting (New) General ledgeraccounting Business Transactions GL account posting Make and check document settings Validation in accountingdocument.

    Transaction Code GGB0

  • 8/10/2019 4 8_Validation and Substitution

    25/32

    Validations and Substitutions 25 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

  • 8/10/2019 4 8_Validation and Substitution

    26/32

    Validations and Substitutions 26 of 32

    Select the Message option in Step and

    Field Value

    Message Type E

    Message Number 031

    Message Text User & cannot post to the range ofGL account

    MessageVariables

    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.

    Transaction Code F-02

    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 enterAn error message is displayed which is created in the Demo Step 3.

  • 8/10/2019 4 8_Validation and Substitution

    27/32

  • 8/10/2019 4 8_Validation and Substitution

    28/32

    Validations and Substitutions 28 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 ABXXOperator 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

  • 8/10/2019 4 8_Validation and Substitution

    29/32

    Validations and Substitutions 29 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 E

    Message Class Z1

    Message Number 2XX

    Message Text The user id & can post the document DA type only after25.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.

    Transaction Code F-02

    Field Value

    Company code ABXX

    Document date Todays date

    Posting Date Todays date

    Document type DA

    Posting key 40

    GL account 476900

  • 8/10/2019 4 8_Validation and Substitution

    30/32

    Validations and Substitutions 30 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 SPRO Financial accounting (New) General ledger

    accounting Tools Sets Define Sets Transaction Code 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 SPRO Financial accounting (New) General ledgeraccounting Business Transactions GL account posting Make and check document settings Validation in accountingdocument.

    Transaction Code 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

  • 8/10/2019 4 8_Validation and Substitution

    31/32

    Validations and Substitutions 31 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 E

    Message Number 3XX

    Message Text User & is not Authorized to post inthis company code, document typeKA

    MessageVariables

    SYST-UNAME

    Step 2: Testing the validation in the transaction

    Menu Path Accounting Financial Accounting General Ledger Posting General Posting.

    Transaction Code F-02

  • 8/10/2019 4 8_Validation and Substitution

    32/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 enterAn error message is displayed which is created in the above step.