Search This Blog

Wednesday, April 21, 2010

Enhancing standard BI content master data extractors

Use Of Scenario : SAP provides standard BI content master data to extract the data from R/3 to BI system. When we required additional data to be extracted, other than the standard BI extractor extract from R/3 , we need to enhance the R/3 data source extractor.


Description:



Here we are enhancing standard extractor 0CANDIDATE_ATTR with candidate name. We have candidate name in Z-table Zcandidate. We need to enhance 0CANDIDATE_ATTR to extract the field CAND_NAME.



Step-Wise Process:

Step 1: Enhance the extraction structure first.



Go to Transaction RSA6, select a standard extractor to be enhanced and click on “Enhance Extraction Structure”. We can also give our own name for this structure. Click on OK button.

Add fields to the new structure and activate it.



Step 2: Enhancement of data source Extractor to write code to manipulate the field “CAND_NAME”. Select the extractor and click on “Function Enhancement” or go to Transaction CMOD.

Create a project. Click on “Enhancement assignments” Search for Enhancement “RSAP0001”. Click on “components”.

List of function exits will be displayed.



1. EXIT_SAPLRSAP_001 - allows filling user-defined fields to the extract structure of transaction data for the SAP BW.



2. EXIT_SAPLRSAP_002 - allows filling user-defined fields to the extract structure for master data or texts in the SAP BW.



3. EXIT_SAPLRSAP_003 - allows changing the contents of transfer table that has been generated for a text request.



4. EXIT_SAPLRSAP_004 - allows changing the contents of a transfer table created for a hierarchy request.



Double click on “EXIT_SAPLRSAP_002” Double click on include where we can write code for enhancementWrite the below code to manipulate the data for new fields and activate the project.













Code:

CASE i_datasource. When '0CANDIDATE_ATTR'.

Data: loc_cand_data type RCF_S_BW_0CANDIDATE_ATTR,

loc_name type RCF_S_BW_0CANDIDATE_ATTR-cand_name.Loop at i_t_data into loc_cand_data.* write logic to manipulate new fields.

* select the cand_name form Zcandidate for corresponding candidate.

Select single cand_name from zcandidate into loc_name where objid = loc_cand_data-objid.* assign to work area.

loc_cand_data-cand_name = loc_name.

* modify the record

modify i_t_data from loc_cand_data.

Clear: loc_cand_data .Endloop.. ENDCASE. Again go to RSA6 to change and generate the data source.

Uncheck “Hide field” and “field only” options and also select “selection” option if any field needs to be as selection options for data extraction. Save and generate the data source

Now go to RSA3 and execute the extractor 0CANDIDATE_ATTR to check the data..

Enhance the info object and Replicate the datasource in BI system.

No comments:

Post a Comment