cancel
Showing results for 
Search instead for 
Did you mean: 

Expose OData Deep Entity

mv1985
Participant
0 Kudos

Hello All,

We have data coming from Ariba in form of JSON and residing in JSON collections in HANA Cloud DB, then Calculation Views are exposing the fields, all fields are string types and are storing nested data also like example, customer { first name:,,,last name }, project ID { att1, attr2 },. and many other nested data in different sets and forms.

Is it possible to do deep calls ? like customer and it's first name etc. Because the data type in calculation view is String type, we are facing challenge and using the $expand parameter in API calls, we always get 'navigation property x' not defined.

Any suggestions please, what is the best approach for it and if it's feasible ?

regards,

MV

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

You have assigned several tags to this question starting from NW ABAP Gateway (OData) up to SAP Business Application Studio.

Can you please provide more details about what the platform is on which you want to build an API that "receives deep calls" ?

Are you looking to build an OData API, if yes, which version ? Or do you want to be build a plain REST API?

View Entire Topic
mv1985
Participant
0 Kudos

andre.fischer , Hello, thank you for your reply, Sure I will try to explain as below in detail:

We have data coming (in JSON Format) from ARIBA system that is stored in HANA CLOUD DB (SAP BTP) in one JSON Collection object in a HDI Container. (as per SAP recommendation).

As it's a large JSON, many fields have nested data in them also.

For Example, {ID: 123, Owner : { Name : ABC, Address : CDE, Phone:995 }}, Origin : USA}.......and so on.

You can see, field Owner field has further fields Name Address etc.

Now in SAP Business Application Studio, CAP application is created, an hdbview is created over this single JSON collection exposing all the fields, then a calculation view (CV) is created over this hdbview (where all fields are automatically are of data type NVARCHAR5000.)

Then using CDS file, this CV is exposed as entity with all fields defined in CV, followed by a ready only service in srv file. So, building deploying creates the API Endpoint. When we apply $expand it asks for Navigation property and gives error for the field OWNER. (Testing in POSTMAN).

So this is the first question please, if this approach is correct or what we want to achieve like accessing OWNER->NAME etc. via API parameters?

Finally, we have created a API using this API endpoint in Integration Suite.

$Select, $filter etc. are all working for this OData v4 it seems but expand needs different approach,

If you can please guide on it.

thanks,

regards,

MV