Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to get BADI implementation name

Former Member
0 Likes
3,651

Hi All,

I created a BADI implementation, but I want to be able (for testing purposes) to bypass this BADI implementation. Therefor I created a table in which BADI-implementation name and username are the key fields.

When the BADI implementation is called there will be checked of the user and the BADI implementation name is present in this table.

If so, the BADI will be bypassed.

My question is if there is a possibility to determine the BADI implementation name at runtime (I prefer not to hardcode the implementation name).

So in my badi I call table ZZBADI_OFF:

SELECT SINGLE * FROM zzbadi_off INTO ls_badi

WHERE exit_imp = ????

AND uname = sy-uname.

IF sy-subrc = 0.

EXIT.

ENDIF.

Hope you can help me on this.

Martijn

Hi All,

I created a BADI implementation, but I want to be able (for testing purposes) to bypass this BADI implementation. Therefor I created a table in which BADI-implementation name and username are the key fields.

When the BADI implementation is called there will be checked of the user and the BADI implementation name is present in this table.

If so, the BADI will be bypassed.

My question is if there is a possibility to determine the BADI implementation name at runtime (I prefer not to hardcode the implementation name).

So in my badi I call table ZZBADI_OFF:

SELECT SINGLE * FROM zzbadi_off INTO ls_badi

WHERE exit_imp = ????

AND uname = sy-uname.

IF sy-subrc = 0.

EXIT.

ENDIF.

Hope you can help me on this.

Martijn

4 REPLIES 4
Read only

Former Member
0 Likes
2,019

Hi,

Check this info.

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 BADI’s 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 BADI’s for the given package MB

Hope this resolves your query.

Reward all the helpful answers.

Regards

Read only

Former Member
0 Likes
2,019

HI

AS per my knowledge... wht ever u r doing is correct way.. but we can do it in other way if the BADI is filter dependent.. then u no need to write u r code as above instead u can set the filters.

eg.. badi..BDCP_BEFORE_WRITE will be triggered on the MESSAGE TYPE.. we can set fileter for this badi for the message types

Please Close this thread.. when u r problem is solved. Reward if Helpful

Regards

Naresh Reddy K

Read only

Former Member
0 Likes
2,019

Hi All,

Thanks for your response, but my question has not yet been answered.

I am not searching for BADI's or BADI implementations.

I am searching for a way to find the BADI implementation name <u>within</u> the BADI implementation.

Regards,

Martijn

Read only

0 Likes
2,019

Hello,

starting with NetWeaver 2005s we have two BAdIs which are implemnted different.

So I suggest that you don't try to interprete BAdI-Tables.

Why don't include the select on your username table into your implementation?

Regards

Michael