Hi,
I tried to automate a master data creation in SAP. A data table with several columns and rows is to be automatically entered in SAP. My problem is that in the invoke workflow, which should create the entries in SAP in a loop for the individual lines, the following error message appears: “Option Strict on” disallows late binding. I followed the workflow from the video tutorial “Project Organization”. Can someone tell me where and what my error is?
The variable has the following form: DataRow(counter)(“Column name”).ToString
(the same like in the video tutorial)
DataRow can only have the column in parentheses, but you are trying to use a counter also.
The options you have are to use the DataTable variable with the counter or use the Datarow without the counter.
For example,
DataRow("Column name").ToString
or
ExtractDataTable.Rows(n)("Column name").ToString
Typically, you will be using a For each loop with the DataTable, which you don’t need to declare a DataRow in the variables tab if that is the case.
For example,
For each row In ExtractDataTable
// then either use Assign activities or place the variables in that Scope and assign them with the Default value.
// But, the default value will only work once the row variable is declared at the start of the For each loop
There are times however where you would use a Do While loop and use a counter to reference the DataRow. In this case, then you would want to assign the DataRow either in the Default value with a Scope after the DataTable has been set or using an Assign activity.
For example,
n = 0
Extract Structured Data to ExtractDataTable
Do
Assign DataRow = ExtractDataTable.Rows(n)
n = n + 1
While n <= ExtractDataTable.Rows.Count
Anyway, I hope this extra bit of information is helpful.