For this, there is a transaction program that is created at SAP. This transaction program requires a table as an input. We are able to pass one record in the table and successfully receive a return status. However, for the transaction to be successful, we will need to pass more than one record in the table to SAP in the RFC transaction call.
We are using LSXLC to perform the above. May we ask how this can be done?
You essentially have two options to get the data into SAP. The first is using a simple loop to rebuild the LCFieldList object for each record you wish to insert. If you use this option, be sure to reinitialize the LCFieldList object at the top of the loop using the "Set mylist = New LCFieldList(...)" method of instantiation; otherwise, you may have data from the previous record left in the list. The second option is to build an LCFieldList object that contains all the records. You can do this by determining the number of records to be passed to the transaction and then instantiate the LCFieldList object accordingly; for example, if there are five records to insert you would reinitialize with Set mylist = New LCFieldList(5, ...). You can then use the LCFieldList.Insert(n,...) method where n is the record number (using a simple counter loop works well). If the transaction's return value contains a return status for each record, it should come back as an LCFieldList and you can parse through it similarly to how you built the input list -- by specifying the index value of the list row you want to examine.
Do you have comments on this Ask the Expert Q&A? Let us know.
This was first published in March 2004