Transformation Rules

Overview

You can use transformation rules to calculate fields from business object fields, for example, for date and date/time conversions. The transformed (calculated) fields are added to the data source and can be used in reports.

Availability

Caution

This documentation covers the SAP Cloud Applications Studio (“studio”) as a whole; therefore it describes all features that are available within the studio. Not all of these features are available for every cloud solution from SAP. Before using a particular feature, please consult the Feature Matrix to determine whether the feature is available for the cloud solution from SAP for which you are creating your solution.

For details, see Feature Matrix.

End of the caution

Use

Business objects often contain date and date/time information, for example, for the release of an order. In reports, you normally want to aggregate data in time buckets, for example, to view the orders per month. For this purpose, you could define a DateToMonth or DatetimeToMonth transformation rule. As a result, the system adds a new field to the data source that contains only the month of the release datetime field. In a report, you can then easily aggregate the order data by using the month field.

You select transformation rules in the Data Source Wizard. For information about how to create a data source using the Data Source Wizard, see Create a Data Source.

Available Transformation Rules

Transformation rules are only available for fields of the data types GLOBAL_DateTime, Date, and the Name, Description, and Text data types, which represent character strings.

Transformation Rules for Date/Time Fields (GLOBAL_DateTime Data Type)

Rule

Description

DatetimeToTime

Selects and retrieves only the time from a datetime field.

DatetimeToDay

Selects and retrieves only the day from a datetime field.

DatetimeToDate

Selects and retrieves only the date from a datetime field.

DatetimeToCalendarweek

Calculates the calendar week of a datetime field.

DatetimeToMonth

Selects and retrieves only the month from a datetime field.

DatetimeToQuarter

Calculates the quarter of a datetime field.

DatetimeToYear

Selects and retrieves only the year from a datetime field.

DatetimeToYearmonth

Selects and retrieves only the year and month from a datetime field.

DatetimeToYearquarter

Calculates the year and quarter of a datetime field.

DatetimesToDuration

Calculates the number of days between two datetime fields. *

Transformation Rules for Date fields

Rule

Description

DateToMonth

Selects and retrieves only the month from a date field.

DateToYearmonth

Selects and retrieves only the year and month from a date field.

DatesToDuration

Calculates the number of days between two date fields. *

Transformation Rules for String Fields

Rule

Description

Concatenate

Concatenates two string fields. *

Note

* To use this transformation rule, you must select a second field.

End of the note