Author: Abyson Joseph Chavara
Created on : 04.03.2014
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.
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 .
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
5 | |
3 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 |