Custom DS on Field

Previous  Home  Next

The above 3 types just mentioned were the built in DS types provided in Mapper. What if we want to check the values “on the Fly” during Run time & perform some action based on that?

Custom DS is the answer. Select “Custom Dynamic Skip” from the drop-down for amount field.

DS7

Custom DS screen will pop-up. This is a small IDE, where users can write their VB.Net code to perform various Run-Time actions based on the data they put in their excel data sheet.

Besides the inbuilt DS types that we discussed before Custom DS also supports various options.

DS8

Let us understand the pre-defined variables and return types that can be used in Custom DS on field with VB.Net code.

 

Variables

Description

iSheet

Current excel sheet

iCurrentExcelRowNumber

Current absolute excel row number

iValue

Current value pertaining to mapping

iMapType

Mapping Type

iMapValue

Mapped Value

iExcelLogColumn

Excel Log column

iExcelStatusColumn

Excel Status column

iLoopExcelHeaderRow

Looping header row

iLoopExcelEndRow

Looping End Row

IsTestRun

Check whether Current Run Is Test Run

IsLineLevelTestRun

Whether Line Level Test Run or Whole Document 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/preparing rows for Run

IsHeaderLevelTestRun

Whether Line Level Test Run is executing And Header Row is Executing in Loop

iReturnID

Return ID in Log/Status column

iReturnMessage

Return Message in Log/Status column

GVar1, GVar2, GVar3, GVar4, GVar5

Object variables

 

**These variables are valid only per call and will be reset once the call is finished.

These are object variables, so you can store any value (eg. Int, float,

text..etc.) in that.

GVars

Hash table object

Return Types: (Any other value will continue the operation as if Dynamic Skip was absent)

0:   Default return value.

This will tell Process Runner to send the row to SAP and not suppress it.

 

1:   Suppress or do not send the field to SAP.

This will tell Process Runner to suppress a row and will not send it to SAP.

 

2:   Skip current excel row.

This will tell Process Runner to skip a row and not send it to SAP.

 

3:   Skip current call.

This will skip one entire call to SAP.

 

4:   Stop current SAP execution.

Similar to pressing Stop button in Process Runner.

 

Example 1:

 

If Trim(iSheet.Cells(iCurrentExcelRowNumber, "i").Text) = "31"

           Return 0

else

           Return 1

End If

 

The above code tells Process runner if there is “31” in column “I” for the current row in current sheet then only execute (Return 0) the row else suppress (Return 1) it.

 

Example 2:

 

Here we will see a small example that if we encounter “$” in amount field it should stop the transaction.

DS9

iValue contains the field value for which we have defined Custom DS.

It’s “amount” here.

Following is the VB.Net code:

If Ucase(Trim(iSheet.cells(iCurrentExcelRowNumber , "I").Text)) = "$" Then

iReturnID = "P:DS-Z04"

iReturnMessage = "Call to SAP stopped due to custom DS"

Return 4

End If

Returning 4 will stop the transaction there itself.

To test your code, enter $ in iValue & click on Test button.

It will display Result: 4 (the return value).

Look at the description below it.

** If there is any Syntax error in your code it will also notify about that.

DS10-2

Click on OK button. Run it.

DS11-2

 

Click here to see an example 'How to restrict process file to be executed in a particular SAP system' using Custom Dynamic Skips.

 

Next:

Dynamic Skip on Screen