In this post, we will discuss the differences between Kernal / New BADI and Classic BADI.
1. Calling BAdI methodsA classic BAdI can be called only once and the call positions are registered centrally.
With new BAdIs, multiple calls are possible and the call positions are not registered centrally.
For the above reasons, an automatic call migration is not possible.
2. BAdI object
Classic and new BAdIs differ in a number of features that are important for migration:
The BAdI object for classic BAdi is created by calling a factory method and referenced via a reference variable of the type of the BAdI interface.
BAdI object for New BAdIs is created via the ABAP statement GET BADI as a handle for the calls of BAdI methods, and referenced via a reference variable of the type of the BAdI. A BAdI object is an instance of an internal BAdI class, which otherwise is invisible to the outside.
3. Passing comparison values for the filter
Filter values for comparison for classic BAdis are stored in a structure and passed with the call of the BAdI methods.
Filter values for comparison for New BAdis are used to search for implementations that are passed when the BAdI object is created with the GET BADI statement.
There is no way of migrating the call of the factory method one-to-one into the ABAP statement because GET BADI can also return an existing BAdI object, which is not possible with the factory method.