2007 Dec 18 11:20 AM
Hi All,
1) I would like to know how can we locate BADI's in a program.
2) How a BADI is callled from the program.
3) Difference between BADI and User Exit.
Thanks in Advance
Hi All,
1) I would like to know how can we locate BADI's in a program.
2) How a BADI is callled from the program.
3) Difference between BADI and User Exit.
Thanks in Advance
2007 Dec 18 11:23 AM
Hi,
BADI's can be located using the Key Word Exit.
Difference between the BADI and User Exit is that BADI can be used Multiple Times whereas a User Exit can be used only once.
Regards,
Sai
2007 Dec 18 11:27 AM
Aman,
BADI is called as follows:
After their definition and independent of an implementation, BAdIs can be called using a combination of the ABAP statements GET BADI and CALL BADI:
· GET BADI FILTERS f1=x1 ... fn=xn selects the BAdI implementations whose filter condition is met by the filter values specified in the statement. The BAdI implementation classes assigned to the selected implementations are instantiated and passed to a simultaneously created BAdI object which serves as a handle for the implementation.
· CALL BADI badi->meth addresses the BAdI object which passes the call of BAdI methods to the object plug-ins known to the BAdI handle.
For detailed information about these statements, see the ABAP Keyword Documentation.
In the context of the Enhancement Framework, the above statements together form the enhancement spot element calls of an explicit enhancement option. Conceptually, they are part of the definition of an enhancement option.
Procedure
For a multiple-use BAdI, several implementations can be called one after the other using CALL BADI. The sequence in which several object plug-ins are called consecutively is the same in repeated calls, but it can be determined in advance in the BADI_SORTER enhancement spot using the predefined BAdI BADI_SORTER:
...
1. Create the new implementation BADI_SORTER.
2. Enter the name of the BAdI whose object plug-ins you want to call in a sorted sequence as the filter condition for the BADI_NAME filter.
3. Create a screen enhancement to query any kind of sort criterion.
The Enhancement Builder then displays this subscreen with each implementation of the BAdI to be sorted.
4. Implement the methods of the BAdI interface IF_BADI_SORTER according to your sort criteria in the BAdI implementation class.
Without this procedure, the sequence is undefined.
Regards,
Sai
2007 Dec 18 11:35 AM
There are various ways of searching for Business Add-ins:
�� You can search in a relevant application program for the string "CL_EXITHANDLER". If a business add-in is called from the program, the "GET_INSTANCE" method of this class must be called.
�� You can then reach the definition of the business add-in using forward navigation. The definition also contains documentation and a guide for implementing the Business Add-In.
�� Use the application hierarchy to restrict the components in which you want to search. Start the Repository Information System, then choose Enhancements -> Business Add-Ins to start the relevant search program.
�� Alternatively, you can use the entries in the relevant component of the IMG.
2007 Dec 18 11:44 AM
Hi
u can find BADI's in different ways...
1>First go to any transaction->iN THE menu bar SYSTEM->STATUS->Get the program name ->double click->u will go to the program attached to the tcode.Now search term will be CALL CL_EXITHANDLER.Now u will get list of BADI'S available..
2>Goto SE24->Give class name as CL_EXITHANDLER->Display->double click on get_instance mathod->Now u will go inside the method->Now put break point on the cl_exithandler.Now go to any transaction code and pass dat..U will see that it will be stopped on the break point which u set on the cl_exithandler...In the exit name u can find list of badi's attached to the tcode..
There are multiple ways of searching for BADI.
Finding BADI Using CL_EXITHANDLER=>GET_INSTANCE
Finding BADI Using SQL Trace (TCODE-ST05).
Finding BADI Using Repository Information System (TCODE- SE84).
1. Go to the Transaction, for which we want to find the BADI, take the example of Transaction VD02. Click on System->Status. Double click on the program name. Once inside the program search for CL_EXITHANDLER=>GET_INSTANCE.
Make sure the radio button In main program is checked. A list of all the programs with call to the BADIs will be listed.
The export parameter EXIT_NAME for the method GET_INSTANCE of class CL_EXITHANDLER will have the user exit assigned to it. The changing parameter INSTANCE will have the interface assigned to it. Double click on the method to enter the source code.Definition of Instance would give you the Interface name.
2. Start transaction ST05 (Performance Analysis).
Set flag field "Buffer trace"
Remark: We need to trace also the buffer calls, because BADI database tables are buffered. (Especially view V_EXT_IMP and V_EXT_ACT)
Push the button "Activate Trace". Start transaction VA02 in a new GUI session. Go back to the Performance trace session.
Push the button "Deactivate Trace".
Push the button "Display Trace".
The popup screen "Set Restrictions for Displaying Trace" appears.
Now, filter the trace on Objects:
V_EXT_IMP
V_EXT_ACT
Push button "Multiple selections" button behind field Objects
Fill: V_EXT_IMP and V_EXT_ACT
All the interface class names of view V_EXT_IMP start with IF_EX_. This is the standard SAP prefix for BADI class interfaces. The BADI name is after the IF_EX_.
So the BADI name of IF_EX_CUSTOMER_ADD_DATA is CUSTOMER_ADD_DATA
3. Go to Maintain Transaction (TCODE- SE93).
Enter the Transaction VD02 for which you want to find BADI.
Click on the Display push buttons.
Get the Package Name. (Package VS in this case)
Go to TCode: SE84->Enhancements->Business Add-inns->Definition
Enter the Package Name and Execute.
Here you get a list of all the Enhancement BADIs for the given package MB.
The simplese way for finding BADI is
1. chooes Tcode Program & package for that Tcode.
2. Go to Tcode se18
3. Press F4
4. search by package or by program.
Difference between customer exits and BAdis.
i. Customer exits assume a two-tiered system infrastructure (SAP - Customers). Where as in case of BAdis you can created and implement enhancements in as many software layers as you like.
ii. BAdis are considered as generalized BTEs that can be used to bundle program, menu and screen enhancements into a single add-in. BAdis can be created and employed in each of the various software levels.
Advantages of BADIs
a) This enhancement technique has the advantage of being based on a multi-level system landscape (SAP, country versions, IS solutions, partner, customer and so on).
b) We can create definitions and implementations of business add-ins at any level of the system landscape.
Following are the Tables which are relevant to BAdis
i. SXS_ATTRT - BAdi Definition list
ii. V_EXT_ACT - Active implementations of an exit
iii. V_EXT_ IMP - Implementation class for an interface+filter
iv. V_EXT_M - BAdis with filters
b) Transaction related to BAdis
i. SE18 - Business Add-in builder
ii. SE19 Implementation of Badi
iii. SE24 Class/Interface Builder
REWARD POINTS IF USEFUL
Regards,
Sreenivas
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |