You are on page 1of 11

Transformations in SAP BI Concept & Usage

Applies to:
SAP BI NetWeaver 2004s. For more information, visit the Business Intelligence homepage.

Summary
The objective of the article is to outline the details around concept and usage of Transformations in SAP BI. Author: Nalin Chawla

Company: Accenture Created on: 10 Feb 2010

Author Bio
Nalin Chawla is working as SAP BI Consultant in Accenture Services Private Ltd and having extensive experience in implementation of BI projects. Kartik Shanmuga is working as SAP BI Consultant in Accenture Services Private Ltd and having extensive experience in implementation of BI projects.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 1

Transformations in SAP BI Concept & Usage

Table of Contents
Transformation: ................................................................................................................................................... 3 Standard BI transformations: .............................................................................................................................. 3 Click on Transfer Values to apply the rule for the BI target field. ..................................................................... 4 Data Enrichment: Cross References .................................................................................................................. 8 Programming Routines: ...................................................................................................................................... 9 Related Content ................................................................................................................................................ 10 Disclaimer and Liability Notice .......................................................................................................................... 11

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 2

Transformations in SAP BI Concept & Usage

Transformation:
BI data transformation process enables you to consolidate, cleanse and integrate data. You can semantically synchronize the data flow from heterogeneous sources. When you load data from one BI object into further BI object, the data is passed through BI data transformation, which converts the fields of the source into the format of the target. There are 3 major usages for data transformation in SAP Netweaver BI: 1. Modifications, enhancements or grouping of the loaded records before writing them into the Infoprovider which will be used for reporting afterwards. 2. Conditional Updates to the Infoprovider in order to make sure that only needed records will be written to the Infoprovider. 3. Transformation of unit, time or currency-code related to a uniform entity, which allows for integrative reporting on all these records.

Standard BI transformations:
BI has provided standard ways for transformations. These are: Direct Assignment: Source field value will be assigned to destination field value without any modification.

Select the source field which you need to assign directly to the target field.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 3

Transformations in SAP BI Concept & Usage

Click on Transfer Values to apply the rule for the BI target field. Constant: The value for field will be made constant. The constant value will be specified in the transformation rule. For every record in BI object, field will have the specified constant value.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 4

Transformations in SAP BI Concept & Usage

Click on Transfer Values to apply the rule for the BI target field. Here In this rule, K4 will be the value for 0FISCVARNT for every record. Formula Calculation: The value for field will be calculated based on formula defined as per requirement.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 5

Transformations in SAP BI Concept & Usage

Select the source field to be used in formula.

Click on the Semantic Check after you have defined the Formula. Target field will updated as per formula definition. ABAP Routine: ABAP routine will be used to calculate value for the specific field.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 6

Transformations in SAP BI Concept & Usage

Select the source fields to be used in ABAP Routine.

Result value will be updated in the target field. ABAP routine can return only one value. Read Master Data: The value for field will be obtained by reading MASTER DATA of an infoobject. Compounding plays significant role for reading MASTER DATA.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 7

Transformations in SAP BI Concept & Usage

Select the source field to be used for reading master data.

Data Enrichment: Cross References


There is no generic BI functionality for a read from an INFOPROVIDER. Therefore you need to implement it yourself in Transformation using ABAP routine only. Normally the function module RSDRI_INFOPROV_READ should be used to read the data from Infoproviders. It is often quicker and easier to implement a select to corresponding DataStore Object table instead of using function module. The Data Store Table is generated if Data Store Object is created. The name of DataStore object table follows a naming convention. For DataStore Object 0SPRO_D1 the name of the corresponding table is /BI0/ASPRO_D100. /BI0/A SPRO_D1 00 Prefix for generated DataStore Object Tables. Name of the DataStore Object without leading zero. suffix for active records (suffix 40 & 50 for inactive & change log respectively).

It is not recommended to program a select statement directly with regard to generated Data Store Object table instead of using the function module, especially when reading from Data Store Object tables, because these DDIC objects exists only after BI Content activation. The select must be implemented with dynamic coding. Make sure you read Infoprovider and master data with each read. Otherwise you will run into data inconsistency problem. Note: Data load performance will decrease if you cross reference data from other Infoproviders during the upload process.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 8

Transformations in SAP BI Concept & Usage

Programming Routines:
Routines should be used if standard BI transformations opportunities are not sufficient. The ABAP coding of the routines is integrated into the generated report that is responsible for data upload to the Infoproviders. The routine itself is a BI object stored in table (RSAABAP). The routine has versions A, M and D like other BI content objects as well. Routines can be assigned to transformations, update rules, transfer rules and infoobject. START Routine: Start Routines can be created for transformation, update rules and transfer rules. During Data transfer process the coding in start routine will be called for each data package at beginning of transformation, update rule or transfer rule processing. In start routine, you have access to all records of an entire data package. The data package size will be determined at runtime and cannot be influenced. Therefore the actual number of records in a data package and number of data package itself varies. Therefore it is not possible to calculate a new key figure values using aggregation/summation of key figures in the data package because you never know if other records for same aggregation level will be uploaded by one of the following data packages. Standard Routine: In standard routines you have access to single, currently processed record which has the work area SOURCE_FIELDS. This routine will be processed for each record after the start routine and is assigned to a single key figure or characteristic. You can assign new values to the key figure or characteristic. You can assign new values to key figure or characteristic by changing the value of RESULT, at end of routine. End Routine: An end routine is a routine with a table in the target structure format as input and output parameters. You can use an end routine to postprocess data after transformation on a package-by-package basis. For example, you can delete records that are not to be updated, or perform data checks. Expert Routine: This type of routine is only intended for use in special cases. You can use the expert routine if there are not sufficient functions to perform a transformation. The expert routine should be used as an interim solution until the necessary functions are available in the standard routine. You can use this to program the transformation yourself without using the available rule types. You must implement the message transfer to the monitor yourself. If you have already created transformation rules, the system deletes them once you have created an expert routine.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 9

Transformations in SAP BI Concept & Usage

Related Content
Further Reading & References Sdn,sap.com www.Help.sap.com For more information, visit the Business Intelligence homepage.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 10

Transformations in SAP BI Concept & Usage

Disclaimer and Liability Notice


This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 11

You might also like