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

regarding BAdI

Former Member
0 Likes
567

Hi

I created a BAdI. Now I want to use this in My Program.

So, Wat is the code I need to write to call BAdI in my report.

I need sample code.

Regards

Sandeep Reddy

Hi

I created a BAdI. Now I want to use this in My Program.

So, Wat is the code I need to write to call BAdI in my report.

I need sample code.

Regards

Sandeep Reddy

4 REPLIES 4
Read only

Former Member
0 Likes
554

Hi Sandeep,

You should not create and can't create your own BADIs, you have to implement the BADIs only when there is already a BADI Definition. You can not use the BADIs however you want. BADIs will be linked to particular transactions and they will get triggered when the transaction gets executed.

Regards,

Satish

Read only

Former Member
0 Likes
554

Hi,

Please see the link on the process of calling the BADI into an ABAP program

Regards

KIran Sure

Read only

Former Member
0 Likes
554

SE18 contains the BADI definitions, and you can implement some using SE19 transaction.

As you implement some BADI, you can code some of it's methods, which will be called under standard transactions.

That's the BADI purpose: to enhance an existent standard transacion.

Read only

Former Member
0 Likes
554

You must handle calling BADI from your program by:

data : obj type ref to <badi interface name>.

parameters: p_matnr like mara-matnr.

start-of-selection.

CL_EXITHANDLER=>GET_INSTANCE

instance = obj

exceptions

-


if sy-subrc = 0.

-


else.

callmethod obj->get_material

exporting

p_matnr = p_matnr

changing

x_mara = mara.

if not mara is initial .

write : / -


endif.

endif.

Reward if useful.

Dara.