Badi Example
Badi Example
BADI implementation in the MM02 transaction to change the material description.When the customer needs more
functionality in the SAP standard Program (Functionality) then we can add extra functionality to standard SAP functionality
through BADI. BADI can't disturb the original (standard) code.
Adding extra functionality to the standard is nothing but Add-in.
BADI are not created in the program itself. They are created and maintained separately and called when we need the BADI.
In the given tutorial BADI implantation of transaction MM02 is done as to change the description of the material number, for
that I have explained the way to find the appropriate BADI according to the requirement.
Than we will learn to see all the methods associated with that BADI name and finally implement that BADI to add extra
features.
Steps t o find BADI
Run the transaction SE2 4. Under object type put the class name 'CL _EXITHANDLER' .
Click on display button.
Under this class 'CL_E XITHANDLER' select the method 'GET_INST ANCE' and double click on it.
Under the method 'GET_INST ANCE' put break point on a function module called
'CAL L ME THOD CL _EXITHANDLER=>GE T_ CL ASS_NAM E_ BY_INTERF ACE'
Place the cursor over here and give a break point.
Then according to the requirement run the transaction. In this example transaction code is MM02 .
Run the transaction MM02. As in 1st step we have put a break point, that function module will give all BADI used by the
transaction in each screen and activity on the application (MM02).
Now double click on the changing parameter EXIT_NAM E of the function module to get the name of BADI used in this
transaction.
Now press F8 to again and again to get the list of all the BADI.
We will get following BADI as shown below.
BADI_ SCREE N_ LOGIC _R T
W_RET AILSY STE M_IDENT
BADI_MA TN1
Than again pressing F8 key the initial screen of transaction MM02 will appear.
BADI_MA TERIAL_OD .
Press F8.
Press F8.
ECM_EXIT (Customer Exits for Engineering Change Management)
Press F8.
BADI_LAYER (Layer Value Management for BADIs)
Press F8.
BADI_MATERIAL_OD (Integration of New Objects in Material or Article Master)
Press F8.
BADI_MAT_F_SPEC_SEL (BADI for Material Special Field Selection)
Press F8.
Change material window will come. In this change the material description.
And savethe changes.You will get the following BADI.
This is how we can change the standard material description using BADI.