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

Multiple use BADI

Former Member
0 Likes
1,062

Hello,

I have created a custom BADI definition of multiple use type and one implementation for it n it is working fine but now i want to create multiple implementations for it.

But when im trying to use method of second implementation in my program its raising an error that this method is not defined.

Hope u understand my query.Plz explain me with an example that how to implement multiple use BADI's.


Thanx n Regards

Mouneesh

3 REPLIES 3
Read only

Former Member
0 Likes
768

Hi,

Initially u have to deactivate ur first implementation in CMOD transaction and then go on to activate new method in implementation as only one implementation remains active at a time in BADIs.

Regards..

Surya

Read only

Former Member
0 Likes
768

Hi, Take the example of the badi definition 'ACC_DOCUMENT' which has the option 'Multiple Use' ticked in the propertied tab. This badi has interface 'IF_EX_ACC_DOCUMENT' which has two methods 'CHANGE' and 'FILL_ACCIT'.

Let us assume that we are creating a implementation ZIMPL1 for this badi using the tcode SE19. While creating the implementation, SAP proposes a ZCL1 class which can be used to implement the interface methods 'CHANGE' and 'FILL_ACCIT'.

You can also create another implementaiton ZIMPL2 which will have class ZCL2 to implement the interface methods.

Like above, you can create multiple implementations for the badi if the option 'Multiple Use' is ticket.

Hope this information helps.

Read only

Sandra_Rossi
Active Contributor
0 Likes
768

Hi Mouneesh,

Mouneesh Raj wrote:

I have created a custom BADI definition of multiple use type and one implementation for it

Are you sure you want to create a BAdI definition? This is usually reserved to SAP or for advanced programmers who develop applications that other could enhance.

But when im trying to use method of second implementation in my program its raising an error that this method is not defined.

When you have a BAdI definition with multiple implementations allowed, the calling program must call the method once, and SAP will call automatically all the implementations.

Could you give us more details about what you want to do, what is the context and what is your code?


Regards

Sandra