Skip to Content

Restful Web Services | Get query filters used in a report

Hi,

I would like to know if it is possible to get the query filters used in a webi report using RESTful web services.

This question was asked here : https://archive.sap.com/discussions/thread/3890808# but no answer had been given.

Thank you

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Jul 11, 2018 at 09:25 PM

    I think that this request returns prompts of the report.

    What I want is the filters that we select in the query panel (cf. image) after chosing the prompts values.


    capture.png (36.2 kB)
    Add comment
    10|10000 characters needed characters exceeded

    • Ok thank you. However, as you see here, I tried with a basic report : it returns the good results objects but the ones in the filter are not appearing, "parameters" is empty.

      capture.png

      get : http://<adress>:<port>/biprws/raylight/v1/documents/<DocId>/dataproviders/DP0

      {"dataprovider": {
         "id": "DP0",
         "name": <name>,
         "dataSourceId": <id>,
         "dataSourceType": "unx",
         "updated": <date>,
         "duration": 0,
         "isPartial": false,
         "rowCount": 0,
         "flowCount": 1,
         "dictionary": {
             "expression": [
               -0: {
                  "@qualification": "Dimension",
                  "@dataType": "String",
                  "id": <i>,
                  "name": "Code postal",
                  "dataSourceObjectId": <id>,
                  "formulaLanguageId": "[Code postal]"
               },
               -1: {
                  "@qualification": "Dimension",
                  "@dataType": "String",
                  "id": <id>,
                  "name": "Département",
                  "dataSourceObjectId": <id>,
                  "formulaLanguageId": "[Département]"
               }
            ],
         },
         "query": "SELECT .... FROM ..."
      }
      

      get : http://<adress>:<port>/biprws/raylight/v1/documents/<DocId>/dataproviders/DP0/parameters

      {
         "parameters": ""
      }

      Do I have to modify some settings of the restful web service to get the same response as yours ?

      capture.png (25.3 kB)
  • Mar 21 at 03:04 AM

    This is not an answer, but a confirmation that Gerard's assertion is correct: the /.../parameters request for each Data Provider does not return the query filters, only the prompts (which happen to show in the same area of WebI's query panel).

    Imagine that you have 2 filters, 1 of which is a prompt, and another a static one. The request would return only the prompt.

    Currently, after having read and revisited the SDK guide, and using a 4.2 SP6 system, it does not seem like you can get something as simple as the query filters. It is such a simple requirement, and considering how you can get so much detail down to each report object, it is surprising that something so important as the query filters is just not available, so I hope someone will prove me wrong here.

    This is important because a very common reason for people to rely on SDK is to get BO metadata which is either incomplete in the audit database or simply unavailable in the CMS universe, or cumbersome in the output of the AdminTools/QueryBuilder. One such example is something as absurdly simple as fetching all objects used in a WebI report. Nothing fancy, just tell me what objects exist inside the report, so I don't have to open 300 reports, one by one, and take a screenshot of each query panel, for each query. REST SDK requests could have been a solution for this, but since you cannot get the query filters, you always end up with an incomplete picture of the report, so for now I suppose the only alternative to painful screenshots or expensive SAP additional products (Information Steward), I think you can only achieve that via the application (non REST) SDK libraries.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 04 at 03:19 AM

    I've logged a ticket, and now I have an answer for this: there is a way to get that, but the data format can only be accepted in XML. The REST query is:

    "/biprws/raylight/v1/documents/00000/dataproviders/DP0/specification"

    00000 = report ID

    DP0 = data provider ID

    This will return all filters and conditions from each query in a WebI document. Just don't forget to change the "accept" header to XML, as per REST documentation.

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 11, 2018 at 11:50 AM
    -1

    to get the query filters:

    http://<host>:6405/biprws/raylight/v1/documents/<doc id>/dataproviders/<DP id>/parameters

    example:

    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <parameters>
     <parameter optional="false" type="prompt" dpId="DP0" primary="true">
      <id>0</id>
      <technicalName>Enter Year</technicalName>
      <name>Enter Year</name>
      <answer constrained="false" type="Text">
        <info cardinality="Single" keepLastValues="true">
        <lov hierarchical="false" partial="false" refreshable="true" searchable="true" mandatorySearch="false" searchScopes="Values" searchTargets="Server">
        <id>UNIVERSELOV_DS0.DObc</id>
        <updated>2018-07-07T01:10:36.000Z</updated>
         <values>
          <value>2014</value>
          <value>2015</value>
          <value>2016</value>
         </values>
         <columns mappingId="0">
          <column id="0" type="String">Year</column>
         </columns>
        </lov>
        <previous>
         <value>2016</value>
        </previous>
       </info>
       <values>
        <value>2016</value>
       </values>
      </answer>
     </parameter>
    </parameters>
    
    


    Add comment
    10|10000 characters needed characters exceeded