BADI is Business Add-Ins which is a new enhancement approach. BADI completely follows Object oriented methodology of class and methods which makes it faster. The main advantage of having BADI over USER-EXIT is we can have multiple implementation and each implementation is restricted with filters criteria.
What are the different types of BADI in SAP?
1.Single use BADI
The badi which is having one active implementation is called single use badi.
2.Multi use BADI
The badi which is having multiple implementation is called multi used badi.
For multi used badi there is no sequence in which the implementation is called.
3.Filter BADI
The BADI which is having multiple implemented can be restricted with filter criteria.
We can define filter values for each implementation.
For example we have a requirement to develop an application which used multiple plant. So in our exit we will define CASE for each and every plant and if some changes needed to be done for any plant we need to do intensive testing for all plant.
CASE WERKS.
WHEN '1001'
'Logic for plant 1001'
WHEN '1002'
'Logic for plant 1002'
WHEN '1003'
'Logic for plant 1003'
But if we use badi then we can have multiple implementation based on plant with each implementation having plant number as filter criteria.
DATA:lo_badi TYPE REF TO Z_DEMO_BADI.
TRY.
GET BADI lo_badi.
FILTERS
plant = lv_werks."1001"
CALL BADI badi->handle_werks
EXPORTING
werks = lo_werks
ENDTRY.
4.Custom BADI
These badi are developed and implemented using T-CODE which are SAP BADI transactions SE18 and SE19.
T-CODE SE18
T-CODE SE19