Skip to Content

Can we expose synonym via xsodata?

Feb 08, 2017 at 07:08 AM


avatar image

Hi All,

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



10 |10000 characters needed characters left characters exceeded

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?

* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Florian Pfeffer
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.


Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks Florian .. i did the exact same steps and ended up getting the same error.

Jasna Dosen 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



10 |10000 characters needed characters left characters exceeded