Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Export Table with NCO 3.0

Former Member
0 Kudos

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

1 REPLY 1

Former Member
0 Kudos

Solved by myself.

You need to declare a new variable for each row.