02-25-2011 4:05 PM
Hi,
I would like to fill a table in my .net environment (Visual Studio and NCO 3.0) and pass the table as a import Parameter via RFC to the SAP System.
If I pass a table with just one line, everything works perfect. If I try to append more lines to my table in vb.net and pass it to the sap system, all the rows in the table are the same as the one I appended last.
Here is my code (the values for the table are just for testing):
Dim uploadAPI As IRfcFunction = ecc.Repository.CreateFunction("ZRFCtestfunction")
Dim binTable As IRfcTable = uploadAPI.GetTable("iv_itab")
Dim am As RfcStructureMetadata = _ecc.Repository.GetStructureMetadata("SDOKCNTBIN")
Dim row As IRfcStructure = am.CreateStructure()
row.SetValue("LINE", "1212121212")
binTable.Append(row)
row.SetValue("LINE", "3333333333")
binTable.Append(row)
uploadAPI.SetValue("IV_ITAB", binTable)
uploadAPI.Invoke(_ecc)
the result in the SAP-System would be a Table like this(both lines are the one I appended last):
-
- 3333333333 -
-
- 3333333333 -
-
Does anyone know what to do get the right(both) lines into the table?
Thanks in advance
02-28-2011 12:11 PM
Solved by myself.
You need to declare a new variable for each row.