on 02-24-2016 1:43 PM
Hi to everybody,
I'm using:
- Visual Studio 2013
- nco30 x64
The aim is obtain the values from some fields from table "header" and table "components" relevat to the BAPI_PRODORD_GET_DETAIL
Surfing in the web, I found a post from Ronald Lim and I followed the steps described by Yearden Jacobson
I'm trying to use BAPI_PRODORD_DETAIL this is my code:
Private Sub GetProdOrdDetails(ByVal odp As String)
Try
Dim funcAPI As IRfcFunction = _ecc.Repository.CreateFunction("BAPI_PRODORD_GET_DETAIL")
funcAPI.SetValue("Number", odp)
Dim myTable As IRfcTable = funcAPI.GetTable("Header")
Dim myElementMetadata As RfcStructureMetadata
myElementMetadata = myTable.Metadata.LineType
funcAPI.Invoke(_ecc)
For i As Integer = 1 To myElementMetadata.FieldCount - 1
MsgBox(myElementMetadata.Item(i).Name)
MsgBox(myElementMetadata.Item(i).Documentation)
Next
Catch ex As Exception
MsgBox("Error:" & ex.Message)
End Try
End Sub
No matter to get the fields name, description and so on, but I need getting the values for each field in the tables, but I don't know how to do.
Is there anybody who knows how?
I thank you in advance
Kind Regards
Celeghin Denis
Hello Celeghin,
please check the samples and the tutorial included in the SDK download how to retrieve data from a table. It contains also the API documentation, which is telling which methods. Just summarized here: The IRfcTable is both an iterator and a data container. Loop over the rows by setting CurrentRow. The number of rows is stored in RowCount. Getting data from the current row is possible with the APIs inherited from IRfcDataContainer, all the Get.... methods. You could use GetString(fieldName) to get the string representation for all values. There are Get methods that fit better for certain data types, e.g. if ABAP tyoe is an INT4, GetInt() will return the .NET int representation of it.
Best regards,
Markus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.