cancel
Showing results for 
Search instead for 
Did you mean: 

RRW3_GET_QUERY_VIEW_DATA

0 Kudos
614

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

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

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