Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
sander_vanwilligen
Active Contributor


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.

Please have a look here to download the attachments.

Step 1: Create Interfaces


SAP Menu: Tools > ABAP Workbench > Development > Class Builder


T/code: SE24


Create the following 2 interfaces as shown in the screenshots:




  • YIF_SAPI_BADI_DATA - BW SAPI BAdI Interface for General Data Transfer;

  • YIF_SAPI_BADI_HIER - BW SAPI BAdI Interface for Hierarchy Data Transfer.



Figure 1: Example of Interface Method


For Interface YIF_SAPI_BADI_DATA, the Parameters can be copied from the corresponding IF_EX_RSU5_SAPI_BADI method, i.e. DATA_TRANSFORM.



Figure 2: Interface for General Data Transfer - Parameters


For Interface YIF_SAPI_BADI_HIER, the Parameters can be copied from the corresponding IF_EX_RSU5_SAPI_BADI method, i.e. HIER_TRANSFORM.



Figure 3: Interface for Hierarchy Data Transfer - Parameters


 

Don’t forget to include the Tag Interface for BAdIs IF_BADI_INTERFACE.



Figure 4: Tag Interface for BAdIs



Step 2: Create Enhancement Spot


SAP Menu: Tools > ABAP Workbench > Utilities > Business Add-Ins > Business Add-Ins > Definition


T/code: SE18


Create the following Enhancement Spot as shown in the screenshot:




  • YBW_SAPI_BADI - BW SAPI BAdI Framework for Extraction Enhancement.



Figure 5: Enhancement Spot


 

On the overview screen of the Enhancement Spot you are able to create one or more BAdI Definitions. Create the following BAdIs definitions as shown in the screenshots:




  • YBW_SAPI_BADI_DATA - BW SAPI BAdI for General Data Transfer;

  • YBW_SAPI_BADI_HIER - BW SAPI BAdI for Hierarchy Data Transfer.


The settings of both BAdI Definitions are basically the same and will be explained by showing the screenshots for BAdI Definition YBW_SAPI_BADI_DATA.



Figure 6: BAdI Definition - Overview


Note: Although not shown on the screenshot, deactivate Multiple Use, activate Limited Filter Use and choose Reusing Instantiation instead of Newly Creating Instantiation.



Figure 7: BAdI Definition - Interface



Figure 8: BAdI Definition - Filter (1)



Figure 9: BAdI Definitions - Filter (2)



Step 3: Implement Standard SAP BAdI


SAP Menu: Tools > ABAP Workbench > Utilities > Business Add-Ins > Business Add-Ins > Implementation


T/code: SE19


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).



Step 4: Create BAdI Implementations


SAP Menu: Tools > ABAP Workbench > Utilities > Business Add-Ins > Business Add-Ins > Implementation


T/code: SE19


This is a recurring action for every new extraction enhancement. Every enhancement gets its own implementing class. Here you can program the actual enhancement independently of any other enhancement.


Create a new implementation of Enhancement Spot  as shown in the screenshots.



Figure 12: Create Enhancement Implementation (1)



Figure 13: Create Enhancement Implementation (2)


Choose the appropriate BAdI Definition according to your needs: BAdI YBW_SAPI_BADI_DATA in general or YBW_SAPI_BADI_HIER for hierarchy DataSources.



Figure 14: Create Enhancement Implementation (3)



Figure 15: Enhancement Implementation - Overview



Figure 16: Enhancement Implementation - Implementing Class


The Filter must be populated with the DataSource name.



Figure 17: Enhancement Implementation - Filter



9 Comments
Labels in this area