Using Transformation Rules

Objective

After completing this lesson, you will be able to use transformation rules

Transformation Rule Options

Transformation Rules

In a Transformation, multiple transformation rules are defined.

Within a transformation rule, the following settings are defined:

  • Source field(s)

  • Rule Type

  • Target fields(s)

  • Aggregation Type: controls how a Key Figure or data field is updated:

    • Summation (for Standard DataStore Object and Data Mart DataStore Object)
    • Minimum (for Standard DataStore Object and Data Mart DataStore Object)
    • Maximum (for Standard DataStore Object and Data Mart DataStore Object)
    • Overwrite (for Standard DataStore Object and Characteristic)
  • Currency/unit conversion

Rule Types

Several options are available when defining a rule type:

Initial

Initial: The field remains empty.

No Transformation

The Key Figures are not written to the InfoProvider.

Note

If there is an end routine, all fields in the end routine's field list are transferred to the data target.

Direct Assignment

The field is filled directly from the chosen source field or InfoObject.

Constant

The field is filled directly with the value entered.

LookUp InfoObject

The InfoObject is updated by reading the master data table of a Characteristic from the source with a key, and a value that contains the corresponding InfoObject as an attribute. The attributes and their values are read from the key, and are then returned.

Note

It is not possible to read additional attributes for the attributes. You have to use routines for this. If the attribute 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.

Look up DataStore Object (advanced)

To read from a DataStore object (advanced), the system first provides you with a proposal for how the fields can be assigned. The key fields must be assigned to the source fields of the transformation. When assigning the fields, the names do not need to be identical.

Staging 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.

If there are more key fields in the DataStore Object (advanced) than in the source, performance problems can occur.

Note

The process of reading master data and DataStore Objects (advanced) 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 with a start routine is not necessary because the performance is very similar.

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 (advanced), 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.

Routine

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

Note

For DataStore Objects (advanced) 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. 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.

0RECORDMODE Calculation for ODP

If the source of your transformation is a DataSource that is supplied with data via an operational data provider (ODP), and the target is either a DataStore Object (advanced) or InfoObject, you need the 0RECORDMODE rule type 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 behavior is provided by the ODQ_CHANGEMODE and ODQ_ENTITYCNTR fields. The 0RECORDMODE field has to be calculated from these fields for use in the SAP BW/4HANA system.

Note

The 0RECORDMODE Characteristic is used to pass DataSource indicators (from SAP systems) to the update. If you are not loading delta requests to the DataStore Object (advanced), or are only loading from file DataSources, you do not need the 0RECORDMODE Characteristic.

Formula

The InfoObject is updated with a value determined using a formula. Using the Transformation Library together with the Formula Builder enables you to create formulas without the need for ABAP coding.

The transformation library has over seventy pre-defined functions in the following categories:

  • Functions for Character Strings

  • Date Functions

  • Basic Functions

  • Mathematical Functions

  • Suitable Functions

  • Other Functions

You can implement self-defined functions in the transformation library in the formula builder. You can integrate existing function modules in these self-defined functions. You can make functions that are not currently contained in the transformation library available for frequent use.

The formula builder has both standard and expert mode. In standard mode, you can only enter formulas using the buttons and by double-clicking on functions and fields. In expert mode, you can enter formulas directly. You can also toggle between the two modes when entering a formula.

Note

A type check is not performed for formula. This means the system does not check if the formula result matches the type of the target field.

Log in to track your progress & complete quizzes