Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member184611
Active Participant

Author: Abyson Joseph Chavara


Created on : 04.03.2014


 


Introduction

 

SAP Business Add-Ins (BAdIs) are one of the most important technologies used to adapt SAP software to specific requirements.

As of Release 7.0 of the SAP NetWeaver Application Server ABAP (SAP NetWeaver 7.0), BAdIs are part of the Enhancement Framework, where they represent explicit enhancement options. We call these BAdIs  classic BAdIs. In addition to their integration in the Enhancement Framework, BAdIs from Release 7.0 onwards differ from classic BAdIs particularly with regard to the fact that they are supported directly by the ABAP runtime environment through ABAP statements. We call these New BADIs or Kernel BADIs.


. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

And that is all about introduction, and you might have read that definition a 100 times..   And further, you all know, the main advantage of Kernel BADIs, its very faster than Classic BADIs.


Some of you might have checked why the kernel BADI is faster than Classic BADI?? Even I did the same and have found some answers as follows.





And after all my research, what I understood is - " The old classic-BADI’s are implemented purely at the ABAP Workbench level; that is, both the definition and implementation are realized as workbench repository objects (global classes and interfaces). Thew Kernel BADI takes it to the ABAP language level with new commands 'GET BADI' and 'CALL BADI'.


Apart from Classic BADI’s which are been called by Proxy class cl_exithandler, Kernel BADI’s are called directly with the reference to the BADI definition via GET BADI and CALL BADI statements.  That is one of the reasons why Kernel BADI is faster than classic BADI. Also in Classic BADI, while we call it via cl_exithandler, we use the reference to the interface rather than BADI definition.”


 


The topic of this document is not about the reason of being faster, but to find whether Kernel BADI is 'really' faster or it is just a technically justified statement.


I didn't get a chance to compare the performance of a Classic and Kernel BADI that process a very similar code.  So I have created and tested such a scenario and just thought of sharing the findings here. Please note, this not an evaluation on the performance of New BADIs, rather I just made a comparison out of my own mere academic interest.


I have created a classic BADI via SE18 (SE18>Utilities>Create Classic BADI),  and added a single method ‘DISP_MESSAGE’ in the interface, as shown below.




Subsequently I have created an Implementation for the BADI via SE19.

 


Since there is no specific requirement, I just wrote a code to show an Information message, as shown below.



The creation and implementation part of classic BADI is over.

Next I have created a Kernel BADI in a new Enhancement Spot and have made an implementation. To know more about creating Custom Kernel BADI’s, check the document Creation of Custom Kernel BADI and Calling it in a Custom Program .


 



 

You can see below that, there is only one method ‘DISP_MESSAGE’ added in the interface, same as we have done in case of Classic BADI.

 



 

The same code is added in the method implementation, as in Classic BADI method.

 



 

Even though we have used separate technique for creating classic and Kernel BADI’s, there is no difference in the code that is to be executed from two BADI’s. But as of our understating the second one, Kernel BADI should take less time for execution than the Classic one.


 


I have created two reports for calling the BADI’s. The first report calls classic BADI via the CL_EXITHANDLER proxy class. As you can see below, the instance is created in type ‘ZIF_EX_BADI_CLASSIC_TEST’ which is the interface used in classic BADI.


 



 

And in the second report program, I have called the Kernel BADI via GET BADI and CALL BADI statements. The instance is created in the type of ‘ZBADI_KERNEL_TEST09’ which is the name of BADI itself.


 



 

Using the TCode SAT (new version of se30), I have executed both the programs to check the net execution time.

 

The result for classic BADI program is as follows.

 



 

And in case of Kernal BADI program, the following result was displayed.

 



 

Comparing the net time in both results, it is apparent that the Kernel BADI executed very much faster than the classic BADI. The kernel BADI did take only 8,400 microseconds, whereas Classic BADI took 52,254 microseconds.

 

 

 

Thanks and Regards

Abyson Joseph


22 Comments