Extraction enhancement can be defined as supplementing additional fields to an extract structure. One part is to extend (enhance) the extract structure with one or more fields. The other part is the program logic to fill these additional fields. It can be applied in any SAP source system. Although technically possible, you will rarely or never use it in the SAP BW system itself.

The best practice for applying the program logic is using the Business Add-In (BAdI) technology, i.e. implementing BAdI RSU5_SAPI_BADI. It is based on ABAP Objects programming techniques such as classes and interfaces. The “older” enhancement technology, i.e. Enhancement RSAP0001, is obsolete and should not be used anymore in new implementations.

One of the main advantages of the BAdI is that you can create more than one implementation. It is now possible to create DataSource specific implementations which are much easier to handle and support.

To make it even more comprehensive, you can create a single “generic” BAdI implementation in combination with an Enhancement Spot. Dynamically the respective DataSource specific BAdI implementation is determined and called. This avoids unnecessary calls for irrelevant BAdI implementations. It also complements the standard SAP BAdI by offering filter functionality: the exit is only processed for a particular DataSource.

The purpose of this document is to describe how to realize such a generic solution, using the Enhancement Spot technology and ABAP Object Oriented programming.

Step 3: Implement Standard SAP BAdI

Create the following implementation of standard SAP BAdI RSU5_SAPI_BADI as shown in the screenshots:

YRSU5_SAPI_BADI – SAPI BAdI Framework for Extraction Enhancement.

Figure 10: BAdI Implementation (1)

Figure 11: BAdI Implementation (2)

The source code of the Implementing Class YCL_IM_RSU5_SAPI_BADI has to be maintained. It can be copied from the attached file YCL_IM_RSU5_SAPI_BADI_v1.txt using the Source Code-Based mode of the Class Builder (t/code SE24).

Got a question for you Sander since you have found a really good way of isolate the enhancement code for each datasource making transports and code changes a lot easier, but is there any way to figure it out from which SAP BW system the call is taking place?

We have 2 SAP BW systems connected to same SAP source system but the enhancement code for the same datasource should be different depending on which system is extracting the data.

Encapsulation is an Object Oriented Programming (OOP) concept that binds together data and functions that manipulate the data, and keeps both safe from outside interference and misuse. Data encapsulation led to the important OOP concept of data hiding. Encapsulation is a mechanism of bundling the data and the functions that use them, and data abstraction is a mechanism of exposing only the interfaces and hiding the implementation details from the user.