Extending SAP DataSources
Data Enhancement in the Extraction Path
Some application areas or information systems such as the logistics information system (LIS) or CO-PA allow you to enhance characteristics that are not contained in the documents by means of enhancements or other methods. These types of characteristics are also determined when a document is posted.
If the data should or must be enhanced at the time of SAP BW/4HANA data extraction, this has to be done by enhancing the DataSource.
Enhancements Using Customer Exits
Customer exits are generally used for the actual enhancement of the data. Customer exits are used to branch to predefined points from the SAP standard program that runs in user-defined subprograms. This enhances the standard functions with the customer’s own requirements.
Enhanced Extraction to SAP BW
If your requirements are not covered by the DataSources supplied with BI Content, you can obtain additional information in a routine by developing your own program and integrating it in a function enhancement.
To integrate a program in a function enhancement, complete the following steps:
1. Define the required fields in an append structure that is appended to the extract structure
of your DataSource.
2. Write your function exit to call up the relevant data sources for your DataSource.
3. Replicate the DataSource in SAP BW/4HANA.
4. Extract the data for your enhanced DataSource.
Beforehand, check whether it might be less work to create a new generic DataSource instead of enhancing an existing one.
Creating and Maintaining Customer Appends
To enhance the extraction structure, in Customizing in the source system (transaction SBIW), choose Business Information Warehouse → Postprocessing of DataSources → Edit DataSources and Application Component Hierarchy
You have to generate the customer append for the extract structure of your DataSources. When you do so, the system proposes a name starting with ZA followed by the name of the extraction structure. Maintain the fields that you want to enhance later. All of these fields
should start with ZZ as a way of identifying their special purpose. Finally, generate your append structure.
The extraction structure from the LO cockpit cannot be enhanced by using the function enhancement provided by the Service API. Alternatively, these DataSources can be enhanced by either assigning additional fields from the corresponding LIS communication structures to the standard extraction structure or by using the enhancement options provided by the LIS communication structures.
Developing Function Enhancements During SAP BW Extraction: Traditional
You must define the function enhancement for filling the new fields in the extraction structure.
You have to create a project before you can use an enhancement like this. You can then integrate one or more enhancements into this project. For our task, SAP provides the enhancement RSAP0001. Remember that an enhancement cannot be used in two projects
There are four different enhancement components that can be used for enhancement RSAP0001. They contain the code for filling the extraction structure. The components are as follows:
● EXIT_SAPLRSAP_001 Transaction data supply
● EXIT_SAPLRSAP_002 Master data and text supply
● EXIT_SAPLRSAP_003 Texts supply
● EXIT_SAPLRSAP_004 Hierarchy supply
Every enhancement project has documentation, which also explains the individual parameters of the function module. To use the enhancement, it must be activated. To display documentation on the entire enhancement, choose Utilities → Display Entire Docu. In the
project management of SAP enhancements transaction CMOD.
Developing Function Enhancements During SAP BW Extraction: Current
Since SAP ECC version 6.0, the current approach is to use a Business Add-In (BAdI) instead of a use exits. The steps to create the BAdI are as follows.
Steps to create the BAdI
1. In SE19, choose Classic BAdI , enter the BAdI Name RSU5_SAPI_BADI, and choose Create Impl.
2. Next to Implementation Name , enter Z<…> and choose Continue .
3. Enter a description next to Implementation Short Text and go to the Interface tab. There are two methods: DATA_TRANSFORM and HIER_TRANSFORM.
4. Double click DATA_TRANSFORM and, to save the BAdI Implementation, choose Yes. Choose Local Object if necessary. The Class Builder screen opens. Make sure it is the data and not the hierarchy transformation.
5. Insert a row under the method and input the code. You can see the code in the system.
6. Choose Activate , select all of the objects, and choose Continue . 7. Go back (F3) and activate the BAdI. Next to Runtime Behavior , it says implementation will be called.
Sample Code for a Function Enhancement
Always use a CASE statement to query the DataSource because this function exit is called with every DataSource.
This example only illustrates the procedure for determining a field value. It does not focus on performance-optimized programming. If the data volume expected is very high, buffers can be used for the material number, block reads, DB buffer mechanisms, field symbols, and so on, to optimize the runtime.
Once the function exit is used, it is called with each extraction (CASE statement required).
The following prerequisites and restrictions apply:
● Key fields must be available for the enhanced content.
● Customer exits are only specific to the append fields.
● The maximum field length is 60 characters.
Do not change the field contents and do not add data records. Be sure that all recommended units of measure are included.
Extractors are executed as background tasks. This means that breakpoints do not have any effect.
The following are prerequisites for troubleshooting the source system:
● Development authorization in the source system
● Troubleshooting authorization in the source system
Follow the following steps to troubleshoot the source system:
1. Log on to the source system.
2. Test and debug in extractor checks (RSA3).
3. Monitor running tasks (SM50).
4. Start extraction with the Data Transfer Process in SAP BW.
5. Locate the process in the monitor and start troubleshooting.
6. Restart the Data Warehousing Workbench after code changes in the customer exit.