Business Example
After consulting the head of the cost center, the head of accounts payable wants to ensure that certain travel expenses are assigned to the appropriate travel cost center.
For your vendor invoice, ensure that only the cost center (TA##1100) is entered for the travel expenses (account 61003000 or 61004000). If you assign an incorrect cost center, you will receive an error message as follows: ‘Gr.##: Assign only cost center TA##1100 for account 61003000 or 61004000. Simulate the validation before you activate it.
1. For the FI application area and callup point 2 line item, create validation G##-VAL with the description Travel costs.
2. Insert the step ‘Account/cost center combination check’.
3. Use the formula editor to define the prerequisite and check for the new step.
4. Define the required message with number 2## (where ## = your group number).
5. Save the validation G##-VAL.
6. Simulate your validation and check whether the expected result appears.
7. Activate the validation for company code TA## and callup point 2.
8. Post a vendor invoice.
9. Deactivate the validation for company code TA## and callup point 2.
Unit 6 Solution 25
Create and Execute a Validation for a Line Item
Business Example
After consulting the head of the cost center, the head of accounts payable wants to ensure that certain travel expenses are assigned to the appropriate travel cost center.
For your vendor invoice, ensure that only the cost center (TA##1100) is entered for the travel expenses (account 61003000 or 61004000). If you assign an incorrect cost center, you will receive an error message as follows: ‘Gr.##: Assign only cost center TA##1100 for account 61003000 or 61004000. Simulate the validation before you activate it.
1. For the FI application area and callup point 2 line item, create validation G##-VAL with the description Travel costs.
a) On the SAP Easy Access screen, go to Tools → Customizing → IMG → Execute Project.
b) On the Customizing: Execute Project screen, choose the SAP Reference IMG button.
c) On the Display IMG screen, choose Financial Accounting (New) under Financial Accounting Global Settings (New) → Tools → Validation/Substitution → Validation in Accounting Documents.
d) On the Change View “Validation of Accounting Documents”: Overview screen, go to Environment → Validation.
e) In the left hand tree structure, choose Line Item.
f) Choose the Validation button.
g) On the Create Validation: New validation (Header data) screen, enter G##VAL in the Validation name field with the description Travel costs.
h) Choose the Step button.
2. Insert the step ‘Account/cost center combination check’.
a) Enter step description Account/cost center check in the Validation Step field.
b) Choose ENTER.
c) In the left pane, choose Financial Accounting → Line Item → Step 001 Prerequisite.
d) In the right pane, double-click structure BSEG and scroll down to find the BSEG-HKONT (G/L) field.
Note:
If required, you can display technical names by choosing Settings → Technical Names.
3. Use the formula editor to define the prerequisite and check for the new step.
a) Double-click the BSEG-HKONT (G/L) field to select it.
b) Choose the = button.
c) Choose Constant.
d) In the Enter Constants: dialog box, enter account 61003000 and choose Continue.
e) Choose OR.
f) Double-click the BSEG-HKONT (G/L) field.
g) Choose =.
h) Choose Constant.
i) In the Enter constants dialog box, enter 61004000 in the G/L field and choose Continue.
j) In the left pane, choose Check under step 001 of your validation.
k) In the right pane, double-click structure BSEG and scroll down to find the BSEG-KOSTL (Cost Center) field.
l) Double-click the BSEG-KOSTL (Cost Center) field to edit it.
m) Choose =.
n) Choose Constant.
o) Enter cost center TA##1100 and choose Continue.
4. Define the required message with number 2## (where ## = your group number).
a) In the left pane, choose Message under step 001 of your validation.
b) Go to Environment → Maintain messages.
c) On the Maintain Messages: Class Z1 screen, scroll through the message table to find message number 2##.
d) Double-click the message number to enter your message.
e) Enter message Gr.##: Assign only cost center TA##1100 for account 61003000 or 61004000.
f) Save your message and choose Back.
g) On the Create Validation: G##-VAL – Step 001 – Message screen, enter 2## in the Message number field.
h) In the Message variables area, enter BSEG (HKONT) in the field next to 1.
5. Save the validation G##-VAL.
a) In the left pane, select the validation G##-VAL.
b) Choose Save.
6. Simulate your validation and check whether the expected result appears.
a) In the left pane, select your validation and choose Validation → Simulate.
Unit 6: Validations and Substitutions
b) On the Simulation: Validation G##-VAL – Data input screen, enter account 61003000 or 61004000 in the G/L field and an incorrect cost center, such as TA##1200 in the Cost Center field.
c) Choose Execute.
Note:
Check whether a message has been issued.
d) Exit the simulation and return to your validation maintenance.
7. Activate the validation for company code TA## and callup point 2.
a) Exit the validation (choose Back three times) and return to the Change View
“Validation of Accounting Documents”: Overview screen.
b) On the Change View “Validation of Accounting Documents”: Overview change the validation OC-GESB with new validation created G##-VAL
c) On the Change View “Validation of Accounting Documents”: Overview screen, enter the following data:
Field Name or Data Type Value
Activtn Level 1
d) Save your entries.
8. Post a vendor invoice.
a) On the SAP Fiori screen, choose Accounts Payable/ Receivables → Create Incoming Invoice.
b) Choose the Company Code button.
c) Enter TA## in the Company Code field, if the corresponding dialog box appears.
d) On the Enter Vendor Invoice: Company Code TA## screen, enter the following data on the Basic data tab page:
Field Name or Data Type Value
Vendor TAV##
Invoice date Yesterday’s date
Posting Date Current date
Amount 400
Currency EUR
Tax Code V0 ((0% input tax no taxable)
Text Travel costs
e) Make sure the Calculate tax checkbox is selected.
f) Choose the Tree On button.
Solution 25: Create and Execute a Validation for a Line Item
g) Choose Screen variant for items → Z_WITH COST CENTER in the left pane.
h) Choose the Tree Off button.
i) On the Enter Vendor Invoice: Company Code TA## screen, enter the following data:
Field Name or Data Type Value
G/L Acct Either 61003000 or 61004000
D/C Debit
Amount in doc. curr. 400 or *
Tax Code V0 (0% input tax no taxable)
Cost Center TA##1200
j) Choose Enter.
k) Examine the message that is output.
l) Correct your entry and enter the correct cost center TA##1100.
m) Choose Post.
9. Deactivate the validation for company code TA## and callup point 2.
a) On the Change View “Validation of Accounting Documents”: Overview chose the line with validation G##-VAL and delete the entry 1 from the Activnt level field.
b) Save your changes.
The validation will not be active for future posting.
Unit 6: Validations and Substitutions