Skip to Content

     In Transform SAP BW Queries into OData Service: Part 1 – Generation and Activation you were able to generate and activate an OData Analytic Service. In this post I will explain how to interpret the Service and Metadata document.

     An OData Analytic Service is no different from any other OData service except that it is annotated with SAP specific annotations that enriches its semantic and behavior. In Part 1 we transformed the Cube (of type query) ZCCA_D21/ZCCA_D21_Q0020 into an OData Analytic Service and we will use the same service in our analysis.

Service Document

     An OData Analytic service created for a cube of type query has one main Entity Type. The Entity Type represents the result of executing a MDX Query against the cube. The contents of the service document is shown below in the image.

— click the image —

Service Document.png

 

Metadata

     The metadata document for the service can be accessed using $metadata OData Command. The image below shows how the Dimensions, Dimension Attributes and Measures are represented as properties of an Entity Type. The Entity Type representing the results of a MDX query is annotated as “sap:semantics=aggregate”

— click the image —

Metadata.png

The table shows how BW objects like Dimensions, Dimension Attributes and Measures are represented in OData. The table shows only the main annotations.

BW Objects OData Representation SAP Annotation
Cube of Type Query Entity Type sap:semantics=aggregate
Dimension Property sap:aggregation-role=dimension
Dimension Attribute Property sap:attribute-for=<dimension name>
Measure Property sap:aggregation-role=measure

Now that you know your Dimensions and Measures via the annotations, you can build your solution/application by extracting this information.

Next – Transform SAP BW Queries into OData Service: Part 3 – Execute OData Analytics Service

To report this post you need to login first.

7 Comments

You must be Logged on to comment or reply to a post.

  1. reda miraoui

    Hi Chandan,


    I have a more important question, when i try to query my odata service i get the following response,


    System query options ‘$orderby,$skip,$top,$skiptoken,$inlinecount,’ are not allowed in the requested URI


    Ps: the Odata service was created based on a Bex easy query


    Best Regards

    Reda


    (0) 
      1. reda miraoui

        hi suma,

        the link is in an internal server , but you’ll find below the query generated , by sapui5

        /wp-content/uploads/2013/12/problem_340015.png

        but when i query the odatavia the browser Results.png

        IS there is any way so i can prevent the sapui5 from generating those system query options or how can i modify the metadata of my odata service, not that im using dataservices version 2 wich allows these kind of system query options, and im not querying any measures

        /wp-content/uploads/2013/12/metadata_340090.png

        Kind Regards

        Reda

        (0) 
        1. Suma C V

          Hi Reda,

          Looking at the URL, it seems like these query operations are fired on ‘Read’ Operation of Entity Result Collection Which is actually not supported. These are supported only on ‘Query’ Options .

          Please check the read URl that is generated.

          Regards,

          Suma

          (0) 
          1. Chandan V.A Post author

            Hi Reda,

            As Suma pointed out System query options like ‘$orderby,$skip,$top,$skiptoken,$inlinecount are valid only for HTTP GET on a collection.

            Regards

            Chandan

            (0) 

Leave a Reply