on 2021 Jun 17 8:06 AM
We're trying (for a month) to retrieve data with RRW3_GET_QUERY_VIEW_DATA, in VBA and no vain. The function call is valid cause it returns true, but the Exception, the Tables and Exports structures (after call) are empty. We dealt with basis, they give us access and right. Here is the code :
Dim sapConnection As Object
Set objBAPIControl = CreateObject("SAP.Functions")
Set sapConnection = objBAPIControl.Connection
sapConnection.client = "...."
sapConnection.Language = "..."
sapConnection.hostname = "bwq........"
sapConnection.user = "........."
sapConnection.Password = "........."
sapConnection.SystemNumber = "..."
sapConnection.System = "BW..."
If sapConnection.logon(1, True) <> True Then
MsgBox "Connection error to R/3 (for " & traitement & " in system " & sapConnection.System & " !)" sapConnection.logoff
Exit Sub
End If
traitement = "RRW3_GET_QUERY_VIEW_DATA"
qrySAPFM.Exports("I_QUERY") = "AD_OPALEPC_MATERIAL"
qrySAPFM.Exports("I_INFOPROVIDER") = "YEEFMATERIAL"
returnFunc = qrySAPFM.Call
If returnFunc = True Then 'It return true
Debug.Print qrySAPFM.Exception 'Empty Exception
Debug.Print qrySAPFM.Tables.RowCount 'Empty Tables
Debug.Print qrySAPFM.Exports.RowCount 'Empty Exports
End If
sapConnection.logoff
Request clarification before answering.
CODE CORRECTION :
Dim sapConnection As Object
Set objBAPIControl = CreateObject("SAP.Functions")
Set sapConnection = objBAPIControl.Connection
sapConnection.client = "...."
sapConnection.Language = "..."
sapConnection.hostname = "bwq........"
sapConnection.user = "........."
sapConnection.Password = "........."
sapConnection.SystemNumber = "..."
sapConnection.System = "BW..."
If sapConnection.logon(1, True) <> True Then
MsgBox "Connection error to R/3 (for " & traitement & " in system " & sapConnection.System & " !)"
sapConnection.logoff
Exit Sub
End If
traitement = "RRW3_GET_QUERY_VIEW_DATA"
'======= cODE Correction this line was missing ===============
Set qrySAPFM = objBAPIControl.Add(traitement)
'-------------------------------------------------------------------------------------------
qrySAPFM.Exports("I_QUERY") = "AD_OPALEPC_MATERIAL"
qrySAPFM.Exports("I_INFOPROVIDER") = "YEEFMATERIAL"
returnFunc = qrySAPFM.Call
If returnFunc = True Then 'It return true
Debug.Print qrySAPFM.Exception 'Empty Exception
Debug.Print qrySAPFM.Tables.RowCount 'Empty Tables
Debug.Print qrySAPFM.Exports.RowCount 'Empty Exports
End If
sapConnection.logoff
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
58 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.