Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Andre_Fischer
Product and Topic Expert
Product and Topic Expert
Based on the following question RAP: Key As Segment capability support posted by 8d8214c7f9734f45be69f95cc0d5aeee I found that I missed to blog about a nice "out-of-the-box" feature available for OData V4 services that lets a consumer use an alternate convention for addressing entities by appending a segment containing the unquoted key value to the URL.

This feature is described in the OData V.4.01 specification OData Version 4.01. Part 2: URL Conventions (oasis-open.org)

That means instead of
/sap/opu/odata4/dmo/ui_travel_proc_m_o4/srvd/dmo/ui_travel_processor_m/0001/Travel('1')

you can use the more REST like syntax
/sap/opu/odata4/dmo/ui_travel_proc_m_o4/srvd/dmo/ui_travel_processor_m/0001/Travel/1

it even works with navigation so that you can use the following URL as well:
/sap/opu/odata4/dmo/ui_travel_proc_m_o4/srvd/dmo/ui_travel_processor_m/0001/Travel/1/_Booking/2


This feature works for OData V4 services based on the ABAP RESTful Application Programming Model but also for services based on a code based implementation based on the SAP Gateway OData V4 framework when using the latest SP of SAP_GWFND.
 
4 Comments