cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to get some reports result

Former Member
0 Kudos

Hi everybody !

I'm trying to get some results reports on RESTFUL BI4 by VBA 2010 with WinHttpRequest object. Some reports are ok, some are not (just got header result)... trying with 600 sec on timout, same result.

My access on webservices are ok.

Status response is ok (200)

Here my code for document refresh :

------------------------------------------

Public Function Refresh_Rep(ByVal Lng_IdDoc As Long, Optional ByVal Str_XML_Parameters As String, _

                                                     Optional ByVal Lng_Timeout As Long = 15, _

                                                     Optional ByVal Enm_MyLanguage As Enm_Language) As Boolean

       

    With Obj_AppBO

        .Open "PUT", Str_MyUrl & "/raylight/v1/documents/" & Lng_IdDoc & "/parameters?lovinfo=false", True

        .SetRequestHeader "X-SAP-LogonToken", """" + Str_MyToken + """"

        .SetRequestHeader "Content-Type", "application/xml"

        .SetRequestHeader "Accept", "application/xml"

       

        Select Case Enm_MyLanguage

            Case 0

                .SetRequestHeader "Accept-Language", "fr_FR"

            Case 1

                .SetRequestHeader "Accept-Language", "en-US"

        End Select

        If Str_XML_Parameters = "" Then

            .Send ("<parameters>" _

            & "</parameters>")

        Else

            .Send (Str_XML_Parameters)

        End If

       

        .WaitForResponse Lng_Timeout

       

    End With

   

    Refresh_Rep = True

   

End Function

------------------------------------------


Here my code to get reports result  :


------------------------------------------

Public Function Get_Result_Rapport(ByVal Lng_IdDoc As Long, Optional ByVal Lng_IdRep As Long = 1, _

                                                            Optional ByVal Lng_Timeout As Long = 15) As String

  

    With Obj_AppBO

        .Open "GET", Str_MyUrl & "/raylight/v1/documents/" & Lng_IdDoc & "/reports/" & Lng_IdRep, True

        .SetRequestHeader "X-SAP-LogonToken", """" + Str_MyToken + """"

        .SetRequestHeader "Accept", "text/csv; charset=""UTF-8"""

        .SetRequestHeader "Content-Type", "text/xml"

        .SetRequestHeader "Accept-Language", "en-US"

        .Send

        .WaitForResponse Lng_Timeout

        Get_Result_Rapport = .ResponseText

    End With       

   

End Function

------------------------------------------



I hope my speech is understandable ... I don't practice enough English ...

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

My bad, last report has change during new process (BO XIR2 > BI4) a different parameter ...

So to use report in French, we need 2 headers :

.SetRequestHeader "Accept-Language", "fr_FR"

.SetRequestHeader "X-SAP-PVL", "fr-FR"


Have a nice day guys !

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Daniel, Bonjour Anthony,

I found a solution for almost reports :

When I use this command <.SetRequestHeader "Accept-Language", "fr_FR"> I need to add this one : <.SetRequestHeader "X-SAP-PVL", "fr-FR"> else no data in result.

I checked reports : parameters & data is ok.

One report still answer without data in French. I'll test modifing Get_Result_Rapport to add localization.

Thanks for helping

former_member197386
Active Contributor
0 Kudos

Great Stéphane,

Basically, "Accept-Language" is for message localization when you're using the API.

"X-SAP-PVL" is to specify in which language the document must be opened. It is very important to keep the same value in all your requests because if you changed of value ('fr' to 'en' for instance), the document will be opened in the new locale. That can cause unpredictable behavior if it is not used with a lot of cautiouness.

Regards,

Anthony

PS : if the issue is resolved, please mark this topic as closed

Former Member
0 Kudos

without "Accept-Language" in french, I don't have the localization in French (number, date, etc...)

former_member197386
Active Contributor
0 Kudos

Bonjour Stéphane,

As Dan, I guess some of your reports may be simply empty (no data inside). Or maybe some documents required some prompts to be filled to collect data?

Try to open such reports using BI Launch Pad and trigger a refresh operation to check the behavior.

Best regards,

Anthony

daniel_paulsen
Active Contributor
0 Kudos

Hi Stephane,

My first guess is the parameters passed to the report are resulting in no data returned.

Can you verify that the parameters passed, when no data is returned, actually do return data in BI Launchpad for that particular report tab?

I doubt that its related to the Accept-Language, but just to be sure, is there any pattern to the issue if you use fr_FR?  I see that you only accept "en-US" when exporting to CSV.  I'm not sure if this would affect localization of some specific parameter types.

Dan