Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 16

Purpose

Transformations are used for defining the way how data is loaded from the source to the target of a Data Transfer
Process (DTP).

You can create Transformations also without having a DTP beforehand to model and test their behavior.

Structure
Basically, Transformations are built up from rules, which bind one or more fields of the source structure to a given
field of the target structure.

Furthermore you can build up a complex logic for a Transformation using additional routines.

Rules
Rules define the source fields which are used for loading a given target field, and the operation how the target value
is calulated.

Using rules, it is not possible to use several records from the source, or create several records in the target;
Transformation rules are applied recordwise and create exactly one target record from exactly one source record.

Taking the given source fields as input, using rules you can choose from the following operations (called Rules
Types):

 Constant: assigns a predefined value regardless of the content of the input fields,
 Direct Assignment: copies the value of the input field without any conversion (only the possible conversion
routines defined in the target InfoObject might apply),
 Formula: using this rule type you can define basic logical operations to be performed on the input fields
without having to know the ABAP programming language,
 Initial: assigns an initial value to the target field,
 Read Master Data: using the input field value as a key, you can read the value of a Characteristic attribute
belonging to a specified Characteristic; the InfoObject of the required Characteristic attribute must comply the
InfoObject of the target field of the rule,
 Read from DataStore: using the input field value(s) as a (compounded) key, you can read the data fields of
a specified DataStore Object (DSO); the InfoObject of the required data field must comply the InfoObject of the
target field of the rule,
 Routine: you can implement an ABAP method to calculate the value of the target field based on the values
of the source fields; Routine type rules differ from other Transformation routines in the restriction, that here the result
of the operation must be a single value.

As an example, the transformation below uses 3 rules, 2 of which are Routine types, and one is a Read from
DataStore type.
Rules can be divided into different Rule Groups. The following Rule Groups are available by default:

 Standard Rule Group contains the rules for filling the InfoObjects of the target which were added by the
user,
 Technical Rule Group contain technical controlling InfoObjects (for example Record Mode for DataStore
Objects (DSO)); this Group is available only if applicable.

Rule Type
The rule type defines whether and how a characteristic/key figure or a data
field/key field is updated into the target.

Direct Assignment:

The field is filled directly from the chosen source InfoObject. If the system
does not propose a source InfoObject, you can assign a source InfoObject of
the same type (amount, number, integer, quantity, float, time) or create a
routine.

If you assign a source InfoObject to a target InfoObject that has the same type
but a different currency, you have to translate the source currency to the
target currency using a currency translation, or transfer the currency from the
source.

If you assign a source InfoObject to a target InfoObject that has the same type
but a different unit of measure, you have to convert the source unit of
measure into the target unit of measure using a unit of measure conversion,
or transfer the unit from the source.

Constant:
The field is filled directly with the value entered.

InfoObject 0RECORDMODE is an exception to this. The system


chooses Constant for this, but no value is required. In this case, the constant
is required for delta administration (after images) with DataStore objects or
InfoObjects as InfoProviders. Apart from this, no records are deleted. If your
DataSource return a suitable field for 0RECORDMODE, you can assign this
directly instead.

Formula:

The InfoObject is updated with a value determined using a formula.

More information: Transformation Library and Formula Builder

Read Master Data:


The InfoObject is updated by reading the master data table of a characteristic
from the source with a key and a value and contains the corresponding
InfoObject as an attribute. The attributes and their values are read from the
key and are then returned.
Note
The Financial Management Area characteristic is included in the target but is
not a characteristic in the source. There is a characteristic (cost center, for
example) in the source however. This has the Financial Management Area
characteristic as an attribute. You can read the Financial Management Area
attribute from the master data table and use it to fill the characteristic in target.

Note
It is not possible to read additional attributes for the attributes. You have to
use routines for this.

If you have changed master data, you have to execute the change run. This is
because the active version is read when the master data is read.. If this
cannot be found, the system raises an error.

If the attrribute is time-dependent, you also have to define the read time: On
the current date (sy-date), at the beginning or end of a period (determined by
the time characteristic in the InfoSource) or on a constant date that you enter
directly. Sy-date is used in the default setting.

Read from DataStore Object:


The InfoObject is updated similiarly to during master data reading by reading
a characteristic in a DataStore object. There is no time-dependency however.
Data is read from both the database and near-line storage. If a near-line
storage is found, the system checks automatically whether it contains data
and reads it.

The process of reading master data and DataStore objects on demand is


performance-optimized. The disjunct keys of a complete data package are
read from the database using mass access and buffered for further
processing. This means that customer-defined buffering using a start routine
is not necessary because the performance is very similar.
The system can only read this data if the data part of the DataStore object
contains the target field. The source fields are then identified using the
complete key. The assignment only works using InfoObjects: If the source is a
DataSource, you have to assign an InfoObject to the field.

Note
If there are more key fields in the DataStore object than in the source,
performance problems can occur.

Note
Write-optimized DataStore objects need a semantic key. To avoid
performance problems here, the data must be unique.

You can define how the system should behave if reading fails: The system
either displays an error message or provides a constant.

Routine:
The field is filled by a transformation routine that you have written.

Note
For DataStore objects and InfoObjects: You cannot use the return code in the
routine for data fields that are updated by being overwritten. If you do not want
to update specific records, you can delete these from the start routine.

If you generate different rules for different key figures/data fields for the same
characteristic, a separate data record can be created from the data record's
source for each key figure.

For InfoCubes: You can also select Routine with Unit. Return parameter
'UNIT' is then also added to the routine. You can store the required unit of the
key figure in the parameter, for example 'ST' . You can use this option to
convert the unit KG in the source into tons in the target for example.
If you fill the target key figure from a transformation routine, currency
translation has to be performed using the transformation routine. This means
that no automatic calculation can be performed.

Time Update:
When performing a time update, automatic time conversion and time
distribution are provided.

Direct update: The system performs a time conversion automatically.

Time Conversion:

You can update source time characteristics to target time characteristics using
automatic time conversion. This function is not available for DataStore
objects, as time characteristics are treated as normal data fields. The system
only offers time characteristics that have an automatic time conversion
routine.

Time Distribution:

You can update time characteristics with time broadcasting. All the key figures
that can be added are split into correspondingly smaller units of time. If the
source contains a time characteristic (such as 0CALMONTH) that is not as
precise as a time characteristic of the target (such as 0CALWEEK), you can
combine these characteristics in the rule. The system then performs time
broadcasting in the transformation.

Example
You might for example divide calendar month 07.2001 into weeks 26.2001,
27.2001, 28.2001, 29.2001, 30.2001 and 31.2001. Every key figure that can
be added receives 1/31 of the original value for week 26.2001, 7/31 for each
of weeks 27,28,29 and 30, and exactly 2/31 of it for week 31.

The example is clearer if you compare it with the calendar below:


Time broadcasting always applies to all key figures.

Initial:

The field is not filled. It remains empty.

No Transformation:
The key figures are not written to the InfoProvider. If there is an end routine,
all fields in the end routine's field list are transferred to the data target.

Unit of Measure Conversion and Currency Translation:

You can convert data records into the unit of measure or currency of the
target transformation.

More information:

 Currency Translation During Transformation


 Quantity Conversion During Transformation

0RECORDMODE Calculation for ODP

If the source of your transformation is a DataSource taht supplied with data


via an Operdational Data Provider (ODP), and the target is a DataStore object
or InfoObject, you need rule type 0RECORDMODE Calculation for ODP for
the ODQ_CHANGEMODE and ODQ_ENTITYCNTR source fields. This rule
type can also be used to calculate the 0RECORDMODE field.

If you load deltas from an ODP that does not return just one image type (after
images, delete images and new images for example), this change behaviour
is provided by the ODQ_CHANGEMODE and ODQ_ENTITYCNTR fields. The
0RECORDMODE field has to be calculated from these fields for use in the
BW system.
TRANSFORMATION RULES - FORMULA IN
SAP BI
6/3/2015

0 Comments
 

  Transformation Rules : 
  
  Formula (It is a one of Rule type in Transformation) 

          Transformation is basically used to mapping the fields from source system


to Destination Data Base. Transformation rules are basically used when some
infoObjects not be their in destination, We have to create some Rule type to get
required out put . 

   They are 6 types of Transformation Rule types  

 Direct Assignment.
 Constants
 Reading Master Data 
 Routines
 Formula
 Initial 

Now we have to see FORMULA rule type with an Example :

Take on Sap Delivered Data Source : 0FI_AP_4


Supported DSO  : ZFAP_O03
Supported Info Cube : ZFAP_C03 

Go to sap BI/BW system

TCODE : RSA1
Select Data Source ----> go to Info Package .

Enter the following values in the Data Selection tab ---> in From value and to value 

PSA - Output
Check for The Debit amt in LC
Check for the Credit amt in LC
Double Click on the Data Source ----> Click on Fields Tab

Check for the Bellow fields.


(DMSOL and DMHAB are the Fields)

After this Click on DSO : ZFAP_O03 ,


Double Click on the Transformation
Check this  Fields (DMSOL) (DMHAB)  (SKNTO) are mapped to their infoobjects , 
But one SKNTO is not mapped . 

so you have to Find InfoObject , for this Go to RSOSFIELDMAP table , in fields enter
your field name , it can display your infoobject . Map the required Infoobject with
SKNTO field .
Click on Activate Transformation 
After Activating Transformation ----> Select the Target Field (0DSC_AMT_LC) ----> 
Right Click and Click on Rule Details
Click on Add Source Fields ----> Select the following fields ----> Click on Copy  
Select Rule Type as Formula

 You will get the below Screen Shot


You will get the below Screen Shot 

Enter the following ----> Click on Check and Check the Status


Go back -----> and Click on Transfer Values -----> Click on Transfer Values
Now Activate Transformation.
Now Execute the DTP Request (DSO DTP Request)
New Data Table - Output
You can see the DSC_AMT_LC (It is the CREDIT_LC - DEBIT_LC)

You might also like