Skip to main content

SAP: ODATA query to select option conversion

Submitted by Stefan Barsuhn on

This is how SAP ODATA converts the URL query string (e.g. $filter) into the nice select options that you can access in your ABAP code.

The flow is as follows:

  • on the Gateway side (if your call goes through the Gateway), set an external breakpoint in /IWCOR/CL_DS_HDLR_ROOT=>/IWCOR/IF_REST_HANDLER~HANDLE
  • this will convert the URL query string into context parameters (including select options with your correct ABAP field names)
  • the context is later converted into an XML and sent as body/payload to the receiving server (where your ODATA interface is implemented)
  • here, the XML is converted into an ABAP structure again, where you can access the select options

In other words, don't bother trying to figure out how your query string turns into a list of select options on the receiving system - it's the Gateway that performs the job, based on the metadata it had received from the backend.

I'm not sure how this works in a scenario where you're not using a Gateway server, but I'm sure it's also handled in the Gateway code parts, as it is definitely not handled in the receiving code parts

Tags