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

doubt : BADI!!

Former Member
0 Likes
461

hi experts,

as i have read many times that same Badi can be implemented many times.

let's assume there is BADI 'BADI_1' and i have implemented an enhancement on this badi thru se19 say zbadi_1_11. can i implement one more enhancement with the same badi say zbadi_1_22.is it??

if so then which badi will be triggered first zbadi_1_11 or zbadi_1_22??

please answer.

Points will be awarded for sure.

Gaurav

4 REPLIES 4
Read only

Former Member
0 Likes
441

Both will trigger

Narendra

Read only

Former Member
0 Likes
441

hi Gaurav,

A BAdi definition can only have multiple implementation IF the Multiple Use checkbox in the attributes of the BAdi (as seen from SE18) is checked.

Also one point about BAdi implementation is, that the order in which the implementations are called by SAP @ runtime is not fixed.

In one run of the main application first zbadi_1_11 might be called and then zbadi_1_22 and next time you run the same application the order could be reversed.

Hence when creating implementations, you must be a 100% sure that there is no inter-dependence between two implementation, e.g. you MUST NOT do it this way, that some data updated in implementation 11 would be used for processing in 22.

Hope this helps.

Cheers,

Aditya

Read only

0 Likes
441

hi aditya,

ur answer was very much useful.

As u have mentioned that we need to be cent percent sure about aur multiple implementation for their interdependency.But why do we do multiple implementation??

Gaurav

Read only

0 Likes
441

Hi Gaurav,

You are right, you could do all the development within a single implementation. However there could be the following scenario:

Developer 1: USERA has been given a task to update a database table ZTABLE1 using the data in the BAdi ... so he creates an implementation ZIMP_11 and codes in it.

Now developer 2 USERB has been given another task to update a different ZTABLE2 using the data in the BAdi .

Now the developer USERB can change the implementation ZIMP_11 and code in it, however, it makes sense for him to create another implementation ZIMP_22 and code in it , because:

1. It isolates the two codes and since they are not interdependent he can create an separate implementation

2. Also, there might be a case in the future that the ZTABLE1 should not be updated, however ZTABLE2 shoudl continue to be updated. This would be easy to handle in separate implementations becasue the respect implementation for update can just be activated/deactivated as required.

Hope this answers your Q.

Cheers

Aditya