DataSource Enhancement
DataSource Enhancement
Data Source
Applies to:
SAP BI 7.0. For more information, visit the Business Intelligence homepage
Summary
This article provides a step by step guide to enhance a Standard Datasource as well as an LO Extractor
Datasource with code.
Author: Arminder Singh
Company: Accenture
Created on: 26 November 2009
Author Bio
Arminder Singh is working as SAP BI Consultant in Accenture Services Private Ltd having extensive
experience in implementation of SAP BI projects. His expertise includes SAP BI, ABAP and Business
Objects.
Table of Contents
Overview....................................................................................................................................................... 3
For LO Extractor Datasource: .................................................................................................................... 3
For Standard Data Source: ........................................................................................................................ 8
Related Content .......................................................................................................................................... 15
Disclaimer and Liability Notice ..................................................................................................................... 16
Overview
In almost every project we get into a situation in which some extra fields are required in addition to what’s
already present in a standard data-source. In case of an LO extractor datasource we have a pool of reserved
fields which can be added to the extractor at any time but for other datasources we have to append the
structure and then write an enhancement code for populating the appended fields. We will explain each
process with screen-shots for a better understanding.
Execute the transaction by selecting application 13 and you will get a prompt for your choice, click on
yes.
2. Then we check for any Outbound Queue for the specific application component in transaction LBWQ
and if some entries are present for that then we have to delete them.
4. After completing these steps goto transaction LBWE which is for customizing the data-sources like
enhancements or choosing a different Update Mode depending on the requirement.
Click on the specific application component, and click on maintenance for our data-source.
The next screen shows all the reserved fields available for this data-source and we can just choose
our field from the right side and move it to the left.
After this step our datasource will become inactive and we will see a red light indicator, so just click
on the icon for datasource generation and unhide the newly enhanced field and Generate the
datasource.
After this step the indicator for datasource will turn yellow and now you have to just click on the
Inactive icon to activate this datasource.
5. We are done with the enhancement of the datasource and now we have to reload the setup tables
using transaction SBIW or we can directly use the transaction OLI9BW for our application
component 13 – SD Billing BW.
Just enter the Name of run and enter the termination date & time as per your needs so that all the
documents are processed. Click on execute to start the document processing.
6. After this step we are done with the enhancement on the Source System side and can simply check
in RSA3 whether we are getting the proper data, now just logon to the BI system, replicate the data-
source and activate it for the changes to appear in BI. And thereafter we can do the necessary
mappings and modeling.
If the fields that need to be enhanced are not available in the communication structures of the datasource in
LBWE then we need to follow the below mentioned approach for them as well.
The following screen with all the present fields will appear.
If the enhancement is being done for the first time then you’ll have to create a new append structure
by specifying a technical name.
3. Then you add the new fields with a prefix of ZZ and specify there component type. Afterwards check,
save and activate the append structure and this will appear in the extract structure of the datasource.
One important point to remember is that if you are enhancing with a key-figure then do not forget to
add its respective unit/currency field in the append structure.
4. Now refresh the system and again goto transaction RSA6 and edit the datasource
0VEN_COMPC_ATTR. Unhide the newly enhanced fields which will be present at the end.
5. After completing these steps we need to write an enhancement code for populating these new fields
from there respective table. For this goto transaction CMOD and choose the project for
Enhancements ZBW00001 (in present case), if it’s not present then you have to create a project
using the enhancement RSAP0001. SAP provides enhancement RSAP0001 that can be used to
populate the extract structure.
It has four components that are specific to each of the four types of R/3DataSources:
6. Go to enhancement of Master data attributes datasources and click on include ZXRSAU02. All the
codes will be written inside this include.
Here we are not using the old technique of writing a Case statement and then a When condition for
each datasource as it makes the code quite messy and if several developers/teams are modifying
the code then creates challenges for transport management.
So after using the below code in the Include we can simply create a new program starting with
ZBWIN_XXXX for each data-source which will be independent from any other enhancement so won’t
create any problems.
REPORT ZBWIN_0VEN_COMPC_ATTR.
type-pools: sbiwa.
constants : gc_vbeln type vbeln value '2'.
*&---------------------------------------------------------------------*
*& Form EXECUTE_USER_EXIT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_I_T_SELECT text
* -->P_I_T_FIELDS text
* -->P_C_T_DATA text
* -->P_C_T_MESSAGES text
*----------------------------------------------------------------------*
FORM execute_user_exit
tables i_t_select type sbiwa_t_select
i_t_fields type sbiwa_t_fields
i_t_data structure BIW_LFB1_S " Datasource structure
c_t_messages structure balmi.
REFRESH: I_LFBW,
I_VEN_COMPC_ATTR.
CLEAR: WA_LFBW,
WA_VEN_COMPC_ATTR.
I_VEN_COMPC_ATTR = i_t_data[].
SELECT LIFNR
BUKRS
WITHT
WT_SUBJCT
WT_WITHCD
FROM LFBW
INTO TABLE I_LFBW
FOR ALL ENTRIES IN I_VEN_COMPC_ATTR
WHERE LIFNR = I_VEN_COMPC_ATTR-LIFNR AND
BUKRS = I_VEN_COMPC_ATTR-BUKRS.
IF SY-SUBRC = 0.
SORT I_LFBW BY LIFNR.
ENDIF.
IF SY-SUBRC = 0.
WA_VEN_COMPC_ATTR-ZZWITHT = WA_LFBW-WITHT.
WA_VEN_COMPC_ATTR-ZZWT_SUBJCT = WA_LFBW-WT_SUBJCT.
WA_VEN_COMPC_ATTR-ZZWT_WITHCD = WA_LFBW-WT_WITHCD.
ENDIF.
MODIFY i_t_data FROM WA_VEN_COMPC_ATTR INDEX l_tabix.
ENDLOOP.
Related Content
For more information, visit the Business Intelligence homepage.