cancel
Showing results for 
Search instead for 
Did you mean: 

RFC_READ_TABLE with VB.Net

Former Member
0 Kudos

Hello,

I use RFC_READ_TABLE in VB.Net.

After read, I bind table512 to DATAGRID

but every selected fields are merged into one

datagrid column. How can I split each selected fields

in table512 to each datagrid column?

Thank you in advance for your help.

Teerakorn

This is my VB.Net code :

Private Sub RfcReadMatDoc()

Dim oTableOption As New RFC_DB_OPTTable

Dim oOption As New RFC_DB_OPT

Dim oTable As New RFC_DB_FLDTable

Dim oField_0 As New RFC_DB_FLD

Dim oField_1 As New RFC_DB_FLD

Dim oField_2 As New RFC_DB_FLD

Dim oField_3 As New RFC_DB_FLD

Dim oTable512 As New TAB512Table

'

oField_0.Fieldname = "MBLNR"

oTable.Add(oField_0)

oField_1.Fieldname = "MJAHR"

oTable.Add(oField_1)

oField_2.Fieldname = "MATNR"

oTable.Add(oField_2)

oField_3.Fieldname = "DMBTR"

oTable.Add(oField_3)

'

oOption.Text = "MJAHR = '" & txtDocYear.Text & "' AND MBLNR = '" & txtDocNo.Text & "'"

oTableOption.Add(oOption)

'

Try

SapProxy21.Rfc_Read_Table("~", "", "MSEG", 0, 0, oTable512, oTable, oTableOption)

Catch ex As SAP.Connector.BapiException

MsgBox(ex.Message.ToString)

End Try

Try

DataGrid1.DataSource = oTable512

Catch ex As Exception

MsgBox(ex.Message.ToString)

End Try

End Sub

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thank you for your answer.

Former Member
0 Kudos

Hello,

The function module RFC_READ_TABLE is not released for customer and therefore will not be supported by SAP. Generally, we discourage the use of such unsupported function modules.

To your question, you need to parse the contents of the table "DATA" according to the column descriptions returned by table "FIELDS" and split this one-column SAPTable to a ADO.NET DataTable.

Regards,

Guangwei

Former Member
0 Kudos

can you suggest us a supported function module for a such requirement?