cancel
Showing results for 
Search instead for 
Did you mean: 

Consume xsjs service as xsodata

premchander
Explorer
0 Kudos
261

Hello Everyone,

How to get the metadata in .xsjs service.

For Ex:

I have been consuming two odata services from different systems and consolidating the result from 2 response into single response through xsjs service.

When I am binding this xsjs service response to UI5 smart table, it fails as smart table works with proper metadata.

So is there a way to make my current service response from xsjs service to be exposed as proper metadata response.

or can anyone suggest how the xsjs response to work on smart table.

Accepted Solutions (0)

Answers (1)

Answers (1)

jhodel18
Active Contributor
0 Kudos

Hi Prem,

Technically, XSJS service can work with UI5 OData model if you provide a valid EDMX (metadata) file to it.

I have posted a blog on creating a function import using XSJS:

https://blogs.sap.com/2018/06/11/how-to-implement-function-import-in-hana-xs/

The condition is that if you use UI5 OData model (not particularly the smart table control), then you must abide by the specification of OData Protocol. If you are able to follow the specification, then the use of smart control will work.

Having said that, there's a lot of coding work for you to do to make this happen. I probably won't take that path unless there's a strong justification to do so.

premchander
Explorer
0 Kudos

Hi Jhodel,

Thanks for the answer. To add on the question for the solution article which you shared, will this approach works with the filter, sort, group that normal xsodata support other than passing the parameters as input on the XSJS. Because we have been using the smart table filter.

jhodel18
Active Contributor
0 Kudos

Hi Prem,

The blog post I shared is just to show that it is possible to work in XSJS. But this solution itself won't work on your specific use case because this solution is for OData Function Import. You have to code the solution for your case.