Professional Documents
Culture Documents
Rule Types
Rule Types
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.
Formula:
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.
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.
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.
Initial:
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.
You can convert data records into the unit of measure or currency of the
target transformation.
More information:
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)
Direct Assignment.
Constants
Reading Master Data
Routines
Formula
Initial
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
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