Hi,
I have successfully exececute sap rfc from vb and reterive data. But i could not display the download data in table ???
any help
Private Sub Command1_Click()
Dim SAPFunction As Object ' functions
Dim FM As Object ' our function module
Dim Struct As Object ' R/3 structure
Dim s$ ' any string
' check status
If Status <> "Logon" Then
MsgBox "Please perform Logon first"
Exit Sub
End If
' create FM object
Set SAPFunction = CreateObject("SAP.Functions")
If SAPFunction Is Nothing Then
MsgBox "Creating Functions object failed"
Exit Sub
End If
Set SAPFunction.Connection = Connection
' create function module objects
Set FM = SAPFunction.Add("RFC_READ_TABLE")
If FM Is Nothing Then
MsgBox "Creating function module object failed"
Exit Sub
End If
' assign input
FM.Exports("QUERY_TABLE") = "ZRT_UPLOAD"
' perform call
If Not FM.Call Then
MsgBox "Function call failed"
Exit Sub
End If
'process output
Set objStruct = FM.tables("DATA")
msg text(fm.tables.("data").rowcount())
' report success
MsgBox "Function module processed successfully"
End Sub
Private Sub SAPLogonControl1_Click()
' make new commection
Set Connection = SAPLogonControl1.NewConnection
' logon to R/3
If Connection.Logon(0, False) Then
MsgBox "Connect successful"
Status = "Logon"
Else
MsgBox "Connect failed"
End If
End Sub