If you are working on ABAP on FICO module atleast once you will get a task to create or debug Validations and Substitutions.
Other way is through Menu -- Extras - Expert Trace - Set Breakpoint
If you have any suggestions or tips that you have followed in your work please comment below. We will update the post with them.
To explain about substitution and validation in simple terminology:
Substitutions are generally used to substitute or replace value to the header or item field based on some conditions in your requirement.
Validations are used to trigger an error message by validating some field conditions. If the conditions are met the error won't trigger.
FI Validations and Substitutions
Considering the FI module the tables that will be used in Substitution and Validation are BKPF (Accounting Header) and BSEG (Accounting Line Item).
The T-code for Substitutions is GGB1. For FI Substitution it is OB28.
The T-code for Validations is GGB0. For FI Validation it is OBBH.
For every company code there will be generally three call up point levels present.
1. Document Header Level : Here the header level (BKPF) fields are filled.
2. Document Line Item Level: Here the line item level (BSEG) fields are filled.
3. Complete Document Level : Here both BKPF and BSEG fields can be filled.
When you select one of the levels from the header, item or complete document you will have steps for the level selected. Check the below examples.
Substitution
If the document type (BKPF-BLART) is 'SA' then the document header text (BKPF-BKTXT) will be substituted with document date (BKPF-BLDAT).
Instead of field a user exit can also be used to fill the fields.
To go into the Substitution code place your selection at the main folder of steps and enter the command '= SHCB'.
G_STEP is the variable that can be used to know the step number. For example, the code under G_STEP = '001' is code for step 001. The break point can be set at this points to debug. Reproduce your issue to enter the debugging mode and analyze how the substitution occurs.
Another way to set a breakpoint on step is through the Menu- Extras - Expert Trace and Set Breakpoint.
Below is an example of validation. If the company code is VATO and check document type (BKPF-BLART) is not equal to 'SA' condition is not met then the error 'Document type not allowed with standardizing entries will trigger' (Message Z1 100) will be triggered.
In a similar way like we have explained in Substitution the breakpoint can be set on step number using G_STEP.
Other way is through Menu -- Extras - Expert Trace - Set Breakpoint
Things to remember after creation of Substitutions and Validation steps to avoid issues.
1. Execute the regeneration programs
It is always better to execute the regeneration programs below after creation of Validations and Substitutions. Otherwise you will get issues.
1. RGUGBR00 (Validations and Substitutions)
2. RGSROLNM (Set Regeneration)
2. Create and Maintain Sets
Sometimes your validations or substitutions will not work because you have created sets in development but you forgot to create the same in your quality and production and forgot to maintain it with required data.
T-codes for Sets: GS01 (Set Creation), GS02(Change or Insert Values in Set) and GS03 (Display set).
3. User Exit Object not found
Even after executing the regeneration program sometimes user exit not found issue may occur. In such cases go to the include or pool program where all the user exit codes are visible. Go to Utilities and click on Update Navigation Index.
If you have any suggestions or tips that you have followed in your work please comment below. We will update the post with them.