cancel
Showing results for 
Search instead for 
Did you mean: 

RRW3_GET_QUERY_VIEW_DATA

0 Kudos

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

former_member30
Community Manager
Community Manager
0 Kudos

Hi and welcome to the SAP Community!

Thank you for visiting SAP Community to get answers to your questions. Since you're asking a question here for the first time, I recommend that you familiarize yourself with https://community.sap.com/resources/questions-and-answers (if you haven't already), as it provides tips for preparing questions that draw responses from our members.

Should you wish, you can revise your question by selecting Actions, then Edit (although once someone answers your question, you'll lose the ability to edit the question -- but if that happens, you can leave more details in a comment).

Finally, if you're hoping to connect with readers, please consider adding a picture to your profile. Here's how you do it: https://www.youtube.com/watch?v=F5JdUbyjfMA&list=PLpQebylHrdh5s3gwy-h6RtymfDpoz3vDS. By personalizing your profile with a photo of you, you encourage readers to respond.

Cheers,

Julia
SAP Community Moderator

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