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

badi

Former Member
0 Likes
544

how do you attach a zbadi for a particular tcode

3 REPLIES 3
Read only

Former Member
0 Likes
521

Hi

You are asking in reverse way.

SAP has provided some std BADI's(user exit like things) for most of the SAP Business Transaction codes

so first find a related BADI for the transaction code in SE18

then we implement this badi in SE19 as Zbadi by copying that Std badi and write the code in the methods of that BADI and use it.

So this code will trigger the std transaction as per the requirement

Regards

ANji

Message was edited by:

Anji Reddy Vangala

Read only

Former Member
0 Likes
521

Hi,

Are you trying to create a implementation for a BADI or trying to create a custom BADI ??

If you are trying to create an implementation then you need to goto to se18 give the badi name then use the "Enhancement implementation" menu item and click on create , u can give ur implementation name ..

If you need to create a custom BADI go to se80 chose shift f5 then choose enhancements tab -> key in teh Badi name , then create a implementation, and use the same in ur custom prg.

Read only

Former Member
0 Likes
521

Hi Suresh,

Yes,you are asking the query in a reverse order.

Actually,for every T-code,SAP has provided a lot of BADIs where the customer can write their own codes depending upon the functionality required.

In order to find the BAD for a particular T-code,go to the T-code SE24 and type in cl_exithandler and click on Display.

You will get a list of methods in that class,double click on the Get_Instance method from the list.

you will get the code for that method.Scroll down and you will find one of the parameters "Exit Name" there.Put a breakpoint on that function module and press F8.

In the debugging mode,double click on the Exit Name to get the value contained in it.You will see the first BADI provided in that T-code.

Note down this and then keep on pressng the F8 and noting down the BADIs being displayed.

Now ,you will have to find out the BADI which fits your requirement.

Now,it is not required to opy that BADI into ZBADI.Instead it is better to create a new implementation for this BADI.

Go to the T-code SE18 and see its definition.

Now,go to the T-code SE19 and create a new implementation and write the code there.

Once done,activate that implementation and the BADI also.

Now run the T-code and debug the code that you have written.You can modify the code accordng to your requirements.

In case you have any further clarifications,do let me know.

Regards,

Puneet Jhari.