Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Nested Navigation in CDS OData

winultimate
Explorer
0 Likes
4,907

Hello All,

I am creating a CDS view and publishing as an OData.

The expected metadata is something like

Entity_Type: head

-- Navgitaion: to_item

Entity_Type: item

-- Navigation: to_price

Entity_Type: price

This is what I created:

CDS view head (published as OData){ -- association to item, and association publicly exposed }

CDS view item { -- association to price, and association publicly exposed }

CDS view price

But with this, I do not get the Entity_Type price or the navgiation to_price.

Could you please advice on ho I can achieve this?

1 ACCEPTED SOLUTION
Read only

winultimate
Explorer
0 Likes
1,909

Solved myself.
It appears correctly when we create a SEGW service for the CDS.

Strange behavior. Hopefully SAP will correct it in future relases.

5 REPLIES 5
Read only

winultimate
Explorer
0 Likes
1,910

Solved myself.
It appears correctly when we create a SEGW service for the CDS.

Strange behavior. Hopefully SAP will correct it in future relases.

Read only

0 Likes
1,909

Hello Sajid,

Thanks for providing the feedback to your own question, I wish more people would do that 🙂

However I'm not sure what you mean by 'created a GW service for the CDS'? When you publish it via the CDS annotation, it puts it into an SAP-internal service. How do you make it Did you create this afterwards or publish one of the intermediate services?

Or did you drop the @odata.publish altogether and referenced the CDSs in a custom GW service?

Thanks,

Mike

Read only

winultimate
Explorer
1,909

Hello Mike,
Thanks. 🙂
I wish that too.. It feels sad to see that sometimes we see people having a similar issue to ours and have resolved it themselves but no idea on how they did it.

To answer your question.
Yes, I driooed the @OData.publish altogether. And included it as a reference in the GE service that I created

Read only

0 Likes
1,909
according to this link there is a limitation for creating odata service using auto exposure(@odata.publish annotation)

so it's preferred to create the odata manually using segw and refrence your cds view as the odata model there.