Professional Documents
Culture Documents
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.
Each BADI consists of the method with out implementation called as BADI definition.
We need to create classes to write the abap code by implementing the methods called as
BADI implementation.
SE18 is the T-code for BADI definition, SE19 is the T-code for BADI implementation.
Advantages of BADI
Types of BADI
Filter 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.
We cannot control the sequence of execution of multiple implementations.
Filter BADI It is type of BADI which has a filter value so that only those implementations which
satisfy the filter value are executed. The remaining implementations are not executed this type of
BADI is called a filter BADI.
Properties of BADI
If WITH IN SAP checkbox is selected then this BADI is only used by sap.
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=` .
MESSAGE 'Region is required for German Vendors' TYPE 'E'.
ENDMETHOD.