Skip to Content
0
Former Member
Apr 21, 2005 at 07:28 AM

RFC_READ_TABLE with VB.Net

261 Views

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