A basic knowledge required for every SAP ABAP Consultant, normally I used to serach on google with the tcode to find the definition name. Recently I came across a method to find the definition name for a BADI, but which may already known to many people.
BADI’s are based on OOPS concept, which can have multiple implementations for a single BADI. Each implementations can be activated or deactivated individually with out affecting the other implementation. The disadvantage of BADI’s are no one can assume in which sequence the implementation will process.
The main two tcodes used for creation and implementation are… SE18 and SE19.
It is not that much necessary to use to SE19 only SE18 can be used for creation and implementation.
The steps to follow for finding and implementing….
Go to SE37 (Functional Builder) and display the functional module ‘SXV_GET_CLIF_BY_NAME’. Then keep a break-point on call function line.
Now go to any tcode (like PA30, MM01 … ) for which you require to find the BADI for implementation. Once you process there will be many stops @ the break-point you kept in the above function module. The value in the parameter name is the BADI definition name you are looking for. See that before the display of main screen is something you want for PBO and after the initial screen is for PAI. There may be many BADI’s choose the right one and go for implementing. (As I am a SAP HR ABAP consultant took PA30 for finding BADI)
Go to SE18 and key in BADI definition name you acquired in the above step HRPAD00AUTH_RECORD and press display. Go to the Implementation Menu and press create, it will ask for implementation name see below screen. Next screen go into interface tab and double click on the method. It will take you to another screen for writing the code.
Once after you write your piece of code, just activate all the things. Don’t forget to activate the Implementation.
Now everything has been done and go and execute, the code you have written will be triggered as per your necessity.