Why do we use validation instead of configuration?/What is the purpose of SAP validation rules ?
SAP validation rules ensure data integrity by defining criteria that must be met before a document can be saved.
They help enforce business rules, preventing incorrect or inconsistent data entry.
Standard SAP configuration like document type settings applies at client level and affects all company codes. If a business requirement is specific to a company code, we use validation to control the logic based on conditions such as company code, document type, or field values. Validation allows us to enforce rules dynamically and restrict postings by throwing error messages when conditions are not met.
1. What is Validation in SAP?
Q1. What is Validation?
Answer
Validation is used to control data entry by throwing an error/warning message when certain conditions are met.
👉 It stops the document posting if conditions are violated.
2. What is Substitution?
Q2. What is Substitution?
Answer
Substitution is used to automatically replace field values during document processing.
👉 It does NOT throw an error
👉 It changes the value automatically
3. Key Difference (This is where most people fail)
| Validation | Substitution |
|---|---|
| Throws error/warning | Changes value automatically |
| User must correct manually | System corrects automatically |
| Controls incorrect entries | Auto-fixes entries |
4. Where Validation Works (Important Concept)
Q3. Where can we apply validation in SAP FI?
Validation works only during document posting:
-
Header → BKPF
-
Line Item → BSEG
-
Complete Document → BKPF + BSEG
❌ Not applicable for:
-
Vendor master creation
-
Customer master
-
Other master data
👉 This is a very common trap question
5. Your Scenario (Real Interview-Level Example)
Q4. Explain a practical validation scenario
Answer
Requirement:
Reference number and document header text field should be mandatory ONLY for company code 6310
Problem:
-
If we set it in document type (OBA7) → applies to ALL company codes ❌
-
Requirement is company-specific ✔
Solution:
👉 Use Validation
6. Validation Logic (Most Important Part)
Step 1 – Prerequisite
Company Code = 6310
AND
Document Type = SA
Step 2 – Check Condition
Reference Field = Blank
Step 3 – Message
"Reference is mandatory for company code 6310"
7. Process Flow (Very Important for Explanation)
8. Configuration Steps
Go To "FB01"
Click on company code field and press "f1" and note down technical field name"BKPF-BUKRS"
Click on document type field and press "f1" and note down technical field name"BKPF-BLART"
Click on Document header text field and press "f1" and note down technical field name "BKPF-BLTXT"
Step 1: Create Validation
GGB0
-
Application Area → FI (header section)
-
Call Point → Financial Accounting - > Document Header
-
Create Validation + Step
Validation name = Z6310 ; Validation for 6310 COCD Press Enter
Select Validation "Z6310" and then click on step
Click on "Prerquist"
Click on Tab "Table fields" -> Go to section " List of structures" - >click on field "structure BKPF"
Click on search field :
- BKPF-BUKRS = 6310 andBKPF-BLART = SA
Go to check "2 Check"
Click on Tab "Table fields" -> Go to section " List of structures" - >Double click on field "structure BKPF"
-
Go to Message and then click on message edit button"Maintain Message"
Find the empty place line Message number "39"and double click and write message " For Company code: 6310 Reference is mandatory
Click on save
Message number field = 39
Step 2: Activate Validation
OB28Click on New Entries
CoCd = 6310
CallPnt = 1 (Header)
Validation = Z6310
Activation level = 1(Active)
Click on save and post
Step 3: Test
FB01
-
Company Code 6310 → Error shown ✔
-
Other company codes → No error ✔
9. Key Learning (Consultant-Level Insight)
👉 Configuration at document type level = Client level impact
👉 Validation allows company-specific control
This is why validation is used in real projects
Comments
Post a Comment