cancel
Showing results for 
Search instead for 
Did you mean: 

Can we expose synonym via xsodata?

m_krishnapillai
Explorer
0 Kudos

Hi All,

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

Thanks,

Mahesh

m_krishnapillai
Explorer
0 Kudos

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?

View Entire Topic
pfefferf
Active Contributor
0 Kudos

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.

Regards,
Florian

m_krishnapillai
Explorer
0 Kudos

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

anandmuthu
Participant
0 Kudos

Wrapping the entity in a cds view and exposing still produce the same error.

pfefferf
Active Contributor
0 Kudos

anandmuthu What do you want to say us with that comment on an nearly three year old post? Your comment does not provide any details, just that you have some error. Maybe you create your own question and describe your problem detailed.