How To Use Substitution Method in SAP FI
How To Use Substitution Method in SAP FI
Substitution method is used in SAP just like VOFM routine used in SAP SD. This helps us to validate or
pass some values to SAP at the time of data entry in SAP system.
It's very simple to create a substitution method in SAP system. We just need to follow following steps.
1. Execute t.code 'OBBH' to setup substitution settings. This will ask to maintain following entries in as
shown in screen shot.
Maintain 'Company code' for which it's going to be used. Then maintain 'Validation/Substitution callup
point' as per requirement.
After this enter this substitution and double click on it to create a new one.
After this create a step for Exit or field assignment as per requirement.
Note: Before we pass the Exit Name, we need to create the Exit in RGGBS000 program. This is given in
later part of this blog.
Now we need to make sure that our exit should work for a specific condition only. For this 'Prerequisite'
section is provided. Pass your fields name from the 'Table fields' tab and its value as shown below.
exits-name = 'U903'.
APPEND exits.
* end of insertion
REFRESH etab.
LOOP AT exits.
etab = exits.
APPEND etab.
ENDLOOP.
This will add your exit name in Exit internal table 'ETAB'. After this call your subroutine as shown below.
Here I am using my exit to pass material and profit center at run time.
CLEAR: l_PRCTR,l_matnr,l_vbeln,l_werks.
*Get Delivery
IF sy-subrc eq 0.
FROM lips
IF sy-subrc eq 0.
BSEG-matnr = l_matnr.
FROM marc
IF sy-subrc eq 0.
BSEG-PRCTR = l_PRCTR.
ENDIF.
ENDIF.
ENDIF.
ENDFORM.
Now Save and activate your program. Now your exit U903 is ready to use.
before executing your program just check whether your Exit program is configured in your config or not.
Execute the T.code 'GCX2'. it will display your exit program for the respective application area.
Now we can test and our exit will work at run time and pass the material and profit centre value using
substitution method U903.