Z-Custom Formula

This topic describes how to use the Z-Custom Formula option to access the custom formula editor to write custom code and apply custom business rules to transform the data.

Let us understand the pre-defined variables and return types that can be used in custom dynamic formula on field with VB.NET code.

Variable

Description

iValue

Current value pertaining to mapping

iSheet

Current Excel sheet

iCurrentExcelRowNumber

Current absolute Excel row number

iMap Type

Mapping Type

iMap Value

Mapping Value

IsTestRun

Checks whether current run Is Test Run. This is for Transaction Only.

iLoopExcelHeaderRow

Looping header row. This is for Transaction Only.

iLoopExcelEndRow

Looping end row. This is for Transaction Only.

ReturnScreenName

Returns screen name. This is for Transaction Only.

ReturnScreenNo

Returns screen number. This is for Transaction Only.

ReturnFieldName

Returns field name (without table name).This is for Transaction Only.

ReturnTableName

Returns table name (without field name). This is for Transaction Only.

IsFirstCall

Executes Custom Dynamic Formula only once (first time). This is for Transaction Only.

iExcelLogColumn

Excel Log Column

iExcelStatusColumn

Excel Status Column

IsLineLevelTestRun

Whether line level test run or whole document level test run

IsDRSActive

Is DRS active in current file

DRSBlockValue

DRS Block length

IsDRSBalancingRow

Whether current executing row is DRS Balancing Row

IsRowSelectionPass

Whether the row selection passed in analyzing or preparing rows for run

IsHeaderLevelTestRun

Whether line level test run is executing and header row is executing in loop

SAPProcess

Return SAP Transaction/BAPI/Table name

SAPSystem

Return logged-in SAP System ID

SAPClient

Return logged-in SAP Client

SAPUser

Return logged-in SAP User

SAPLang

Return logged-in SAP Language

SAPSystemNo

Return logged-in SAP SystemNo

For example, consider a custom formula that uses IsFirstCall and ReturnFieldNamevariables for Gross Weight field of MM02- Change Material Process file.

IsFirstCall = True

ReturnFieldName = iSheet.Cells(1, "B").Text

In this example, when the Process file is run, custom formula is run only once and BRGEW field name is returned from the Excel cell. For the file to run successfully, user must change the column name in external Excel file with the field name BRGEW as shown in the following screenshot; else, an error is displayed if any other value is returned. In the following screenshot, an error is encountered if Field Description is used instead of Field Name.