Skip to Content
Technical Articles
Author's profile photo Andre Fischer

Key-as-segment convention support by RAP

Based on the following question RAP: Key As Segment capability support posted by Geert-Jan Klaps 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 (

That means instead of


you can use the more REST like syntax


it even works with navigation so that you can use the following URL as well:


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.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Stoyko Stoev
      Stoyko Stoev

      Hey, Andre,

      This is great indeed - I prefer working this way with OData APIs that are new enough to support it.

      One more tip - handling of composite keys:


      Would become:


      Note that the order is important - the keys must be specified in the order in which they appear in the $metadata.



      Author's profile photo Andre Fischer
      Andre Fischer
      Blog Post Author

      Correct !

      Author's profile photo chethan Santhahalli Ningegowda
      chethan Santhahalli Ningegowda

      Is there any V4 Development example with ABAP without SEGW ?

      Author's profile photo Andre Fischer
      Andre Fischer
      Blog Post Author


      Check out my following blog posts

      As of sap s/4 Hana 2020 fsp1 you can build OData V4 using ADT and rap