Skip to Content
avatar image
Former Member

Can we expose synonym via xsodata?

Hi All,

Can we create a synonym for classic table and then expose this synonym via odata service?



Add comment
10|10000 characters needed characters exceeded

  • Former Member

    Apologies ...

    We are trying to expose a non-HDI table via XSODATA build on XSA. Is it possible to directly add synonym as an entity in OData?

  • Get RSS Feed

2 Answers

  • Best Answer
    Feb 12, 2017 at 12:04 PM

    I tried that case today on a HXE 2.0 system.

    Although I would have assumed that it would work w/o issues I got following result. I set up a "connection" (incl. all grants for the technical/application) user to a non HDI container schema using a user provided service. For a table in that schema a synonym is defined via an .hdbsynonym artifact.

    Creating an xsodata service on top of that schema works from a technical perspective w/o issues, but calling the odata service results in a 404 error from the odata framework with the message "No data found for <synonym name> table." (-> the table contains values can be accessed e.g. in an SQL console via the synonym).

    If a CDS view is created using that synonym and the CDS view is exposed using a xsodata service the odata service works w/o any issues and provides the data. Due to the usage of a view, the usage is limited to read-only scenarios of course.

    For me it seems that there is a gap in the sap-xsodata node module implementation which does not cover the direct usage of a synonym for objects available via user defined services in a 100% way.


    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 31, 2017 at 10:49 AM

    Hi Mahesh,

    maybe it's too late but could be useful for someone else, to expose Synonym as OData service )´(v2.0) you need to wrap it inside calculation view. You have a nice example on youtube SAP HANA Academy channel∈dex=73&list=PLkzo92owKnVwL3AWaWVbFVrfErKkMY02a



    Add comment
    10|10000 characters needed characters exceeded