Wednesday, July 23, 2008

Easy way to find BADI

Easy way to find BADI:

When any requirements of Enhancement comes which needs the implementation of BADI then the biggest hurdle comes in the way that how to find the BADI. Especially this question troubles the fresher most. Then we fresher go through the F4 help provided in the SE18 Transaction if your luck is good then you get it otherwise we go on internet ,SDN and all forums .
In this article I am going to share my simple trick to find the BADI, which I learned through my experience.

Procedure:

1. Go to transaction SE24 i.e. Class Builder.

2. Put the Object type as CL_EXITHANDLER and press Display.






3. Go to the tab of METHODS and double click on the method GET_INSTANCE.



4.When you double click it will lead you to the source code of the method.In the source code at very start you will find code which method is called i.e. get_class_name_by_interface. We need to just put a break-point on that.



5. There we will find a Changing parameter EXIT_NAME .This is the parameter which will tell us that which BADI got Trigger at the point where we want to enhance the logic.



Example:
Suppose you want to know the list of BADI which gets triggered at MM02 when you want to change the Description of the Material.
Just Do the above mentioned steps GO to Transaction MM02 Change the description of and press ENTER .Then the the debugger will start and we will get the names of the BADI which Triggers at PAI of the transaction MM02 after changing the Description Of the material.

Lets change the description of a material.
For e.g . We change the material Description of material TEST MAT.








After changing the material description we will press Enter and then debugger will open .

Here at the debugger we can see the value of parameter EXIT_NAME and we can check the BADI which get triggered.
We have to note down the name of the BADI every time we go to debugger and in SE18 we can check the BADI and its Methods and their parameters and can implement those by SE19.

No comments: