on 12-11-2006 7:53 AM
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
Hi Yogesh,
how are you doing ?
>> Dim FM As Object ' our function module
>>' 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())
if this is in VB.NET, you should get a syntax error when you access the object using 'fm' rather than 'FM'. VBScript would assume vb is a new object and throw a runtime error when you access fm.tables
with respect,
amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.