2

I have exposed an OData V2 Service via the ABAP Service Gateway (SEGW) based on a CDS View. The view contains indirect associations to two other views (entity_1 > entity_2 > entity_3 - no direct connection between entity_1 and entity_3). My problem is that I can't access entity_3 from entity_1 via entity_2. Accessing entity_2 works just fine by using /service_name/entity_1?$expand=to_entity_2 but after that I can't dive any deeper. I tried using /service_name/entity_1?expand=to_entity_2($expand=to_entity_3) but as soon as I put a second query in parenthesis after the first one I receive an error message.

Do I use a wrong syntax or are these nested calls not supported by OData V2? And if it's not supported how do I solve my problem? The service is used in a SAPUI5 application where it should be bound against a tree table so I need (three) different levels in my service.

mxmlndml
  • 144
  • 2
  • 13
  • Does this answer your question? [How to expand multiple properties on OData](https://stackoverflow.com/questions/23977434/how-to-expand-multiple-properties-on-odata) A more general case. Also there's an answer with example of SAP's implementation – astentx Nov 26 '20 at 21:02

1 Answers1

7

Apparently the syntax was wrong. It works if you use /service_name/entity_1?$expand=to_entity_2,to_entity_2/to_entity_3.

mxmlndml
  • 144
  • 2
  • 13