Skip to Content
Jul 26, 2012 at 12:12 PM

What is the use of a user defined BAdI definition?


Hello Experts,

I am new to ABAP and I was reading some basic concepts on BAdIs and I have a question on the utility of User Defined BAdI Definition (created in SE18).

From what I understand, if I create a BAdI definition (in Z namespace) in SE18, I need to do the following:

(a) Define methods in the interface (which is automatically created)

(b) Create a BAdI implementation (in Z namespace) in SE19. Now, I will have to go to the implementing class (which is automatically generated) and add code inside the methods (created in point (a)...see above).

(c) I must create an instance of the implementing class in my application program, and also code the call to the appropriate method (where I added code in point (b)...see above) at the appropriate spot in my application program.

Now, I got stuck with point (c) above. If I, the developer, have to instantiate the implementing class and if I have to call the method at the appropriate point in the application "program", then the "program" has to be a custom program (in Z namespace). Then I might as well, add whatever code I am adding inside the method (as mentioned in point (b) above) in my program directly. Why should I create a BAdI definition, BAdI implementation etc? Then what is the use of a user defined BAdI implementation?

I know I am going wrong somewhere in my basic concepts and would greatly appreciate if you could clarify it.