Skip to main content

Apply Dynamic Formula (DF)

This topic describes how to use the dynamic formula feature of Process Runner DB that allows you to assign specific validations to specific mapping types. Also, the assigned mapped values can be dynamically changed at runtime.

Process Runner DBsupports the following predefined dynamic formulas on field that you can use to transform the data before posting it to SAP. Process Runner DB also supports custom formula to write your custom transformation function in VB.NET.

  • Add Leading zeros
  • Decimal Transform . to ,
  • Decimal Transform , to .
  • Date Transform to DD.MM.YYYY
  • Date Transform to MM/DD/YYYY
  • Date Transform to MM-DD-YYYY
  • Date Transform to YYYY.MM.DD
  • Date Transform to YYYY/MM/DD
  • Date Transform to YYYY-MM-DD
  • SAP Date DD.MM.YYYY Transform to System
  • SAP Date MM/DD/YYYY Transform to System
  • SAP Date MM-DD-YYYY Transform to System
  • SAP Date YYYY.MM.DD Transform to System
  • SAP Date YYYY/MM/DD Transform to System
  • SAP Date YYYY-MM-DD Transform to System
  • Custom Formula

Let's look at the following topics to get an idea of how Dynamic Formula works.

Add Leading zeros

In some cases we require to send a field number of a particular length prefixed with zeros into SAP. For example, consider customer number for BAPI_Customer_Getdetail2. It should be a 10 digit number. So if we have customer numbers as below, we can append zeros with the help of this DF.

  1. Go to the Mapper tab.
  2. Select A-Add Leading Zeros in the Dynamic Formula column for the Customer field.

    Note: This column is visible only when you select the Advance View button in Mapper > Show.

Decimal Transform . to ,

SAP landscape may vary depending on different languages in different countries. For example a decimal point is . in English whereas the same is represented as , in German. So, 112.24 in English = 112,24 in German. The Decimal Transform . to , DF is useful to provide for this transformation.

For example let's look at the data below and the requirement is to change . to ,

  1. In Mapper, select the respective DF for that field.

Date Transform to DD.MM.YYYY

Similar to decimal value, the date format may also differ in separate SAP environments. Let's take an example of a date format (DD.MM.YYYY) in SAP. Meanwhile, the date format in data source column is (MM/DD/YYYY).

  1. In Mapper, select the appropriate DF for the field.

You can see the changed value in SAP on run time.

Custom Formula

This topic describes how to use the Z-Custom Formula option to access the Custom Formula Editor to enter a custom code and apply custom business rules to transform the data. Following are the pre-defined variables and return types that can be used in custom dynamic formula on field with VB.NET code.

Variable

Description

iTable

Current table object

iValue

Current value pertaining to mapping

iCurrentDatabaseRecordNumber

Current absolute Table record number

iMapType

Mapping Type

iMapValue

Mapping Value

ReturnScreenName

Return screen name to change screen name for Transaction only

ReturnScreenNo

Return screen no to change screen no for Transaction only

  1. Go to Mapper and select Advanced View.
  2. Select the field and select Z-Custom Formula from the drop-down list of Dynamic Formula column.
  3. In the Custom Formula Editor window, enter the tranformation rule and select OK.

Was this article helpful?

We're sorry to hear that.