Validation

Transaction codes: Create Validation : GGB0 Create a Set : GS01 Requirement : For all the Transactions for the company code US11, the item text should be a mandatory field. It should be applicable for all the GL Accounts except for two. Let us built this logic through a validation. Go to Transaction GGB0 Go to the level where you want to create a validation and click on Create button.

On the next screen, give a name to your validation

Once the name is given, click on “Prerequisite”

Write the Logic. We are doing this for company code US11.Now. Clcik on the Accounting document Header or the Document Segment depending on the field which we are using in the logic. As the company code is available in the Document Header. . Click on the header to find the field.

Click on Equal to and once it appears on the screen. now as you can see the value is been populated on the screen.Select the company code and click on it. “Constant” and type in the value “US11” . Click on the Tab.

.

To do this. . a set needs to be created. As this Validation is applicable for more than one Document type. go to GS01 transaction.Click on Document type.

Give some meaningful name to the Set Under the table field. In this case go to Transaction OBA7. give the name of the table from which the field is being picked. and get the table. The system asks for the field name within the table Select the Document type fom the drop down list . Select the Basic set and then click on Enter.

Enter the values and save. On the screen Click on “And” and continue The system should check the document type in this set and the validation should apply only for those document types. click on “Set Directory” . Go back to GGB0 screen Select the Field Document Type from the Accounting Document header and click on IN And to select the set that we have created earlier. Once the set is created go back to the transaction “GGB0” to continue.

Now we need to exclude two GL accounts from this Validation.Select the set from the drop down. .

a set needs to be created as well. This time select the Accounting Document Segment to select the field GL account field. Click on “And” And click on the GL field As there are two GL accounts included.Go back to the previous screen and click on Prerequisites. .

.On a new session go to Transaction GS01 to create a set for these two GL fields.

Press enter .

Go back to GGB0 screen. Click on “IN” Select the Set for the GL Accounts from the Set Directory. Click on “And” and then “Not” Select the GL Account Field from the Document Line item. . And click on the GL account.

this logic should be put in a Parenthesis. . Here we are going to click on the Posting Key field from the Account Document Line item .And this rule should apply for all the items with Posting Key 40 and 50. As there is more than one value (40 and 50) and as there is no set maintained for this value. Hence we are going to put this in a Bracket. ( ) “OR “Command cannot be used without being in a Bracket. Start with a Bracket.

. Close the Bracket. The system will save it with a new Step number.Click on Equal to and click on constant and type in 40 Again Click on the Constant button and add 50. Go back and click on Save.

We create a check rule. Now we should create a check. Click on the Line item text from the Document Accounting Line Item. To do this. With this. we have finished the Prerequisites. the system will go through the check and apply whatever is defined in the check. under which the new Step has been created and click on Save again. if the above prerequisites are met. This Check rule will first look if the prerequisites are met. Click on Check under the Step we have created. In our case. then the system should make sure the Line item text field is not empty.Click on the header level as shown below. . If the prerequisites are met then.

to the Transaction SE91 . Once this is done. And click on save. To create the error message if the previous check fails. Click on “<>” which indicates “Not Equal to” And click on constant Press enter without typing anything to indicate blank. Click on Message under the new Step that is created earlier.Click on the line item Text.

And create a new message and save. . Click on change button.Enter the message class and press on Display.

And the message number is 290. .“Enter Short text” should appear if the user does not fill in the Text field. You can see the message number on the GGB0 screen.

I have created the transaction.TESTING: Let us test a Document Type to see if the validation is working. but did not update the Line item text. We are testing for document type “TZ” where the validation should apply. .

Click on Save. Enter the short text and try to save it again. .

And click on Save. .

Sign up to vote on this title
UsefulNot useful