21-BADI in SAP
21-BADI in SAP
21-BADI in SAP
BADI is another way of implementing enhancements to the standard programs with out
modifying the original code.
SE18 is the T-code for BADI definition, SE19 is the T-code for BADI implementation.
Advantages of BADI
Types of BADI
Single implementation BADI:- A BADI which has only one implementation (single class) is
called single implementation BADI.
Multiple implementation BADI:- A BADI which has multiple implementations is called multiple
implementation BADI. By default all the implementations will be executed.
If WITH IN SAP checkbox is selected then this BADI is only used by sap.
If multiple use checkbox is selected then it is a multiple implementation BADI.
If multiple use checkbox is not selected then it is a single implementation BADI.
If filter dependent checkbox is selected then it is filter dependent BADI. We need to
specify the filter type such as land1,bukrs,werks.for the filter BADI.
Double click on the method GET_INSTANCE and put a break-point on the below method
GET_CLASS_NAME_BY_INTERFACE.
Execute the transaction (example VA01), the break-point will trigger, not down the values that
comes to variable exit_name. (Press F8 to get next exit name, continue process until screen
displays).
Some times you may need to use both the methods to find suitable BADI.
You will go to next screen, change any one value and click on Save (Ctrl S).
VENDOR_FIELDSTATUS
GOS_SRV_SELECT
ADDRESS_CHECK
ADDR_TXJCD_CHECK
CVI_CALL_BTE
ADDRESS_UPDATE
VENDOR_ADD_DATA
Based on description and interface signature (importing and exporting parameters) we can
choose and verify some BADI`s
Provide short description, based on description choose a method and double click to add owr
own code.
Here CHECK_ALL_DATA will be useful for final checks, so double click on CHECK_ALL_DATA.
METHOD IF_EX_VENDER_ADD_DATA~CHECK_ALL_DATA.
BREAK-POINT.
ENDMETHOD.
Go to XK02, provide vendor no, select address check box, change any one, save. Now our break
point will trigger, so we can implement this because this is very much suitable for our
requirement. Remove the break point and write the below code for implementing exit.
METHOD IF_EX_VENDER_ADD_DATA~CHECK_ALL_DATA.
IF I_LFA1=LAND1=`DEAND I_LFA1-REGIO=`
TYPE
ENDMETHOD.
'E'.