All topics
ARCHITECTAdvanced

OData Gateway

Master SAP Gateway OData with SEGW, service registration, metadata, CRUD, filters, paging, deep entity, batch, debugging, error handling and Fiori integration.

Overview

Master SAP Gateway OData with SEGW, service registration, metadata, CRUD, filters, paging, deep entity, batch, debugging, error handling and Fiori integration.

Lessons in this topic

  • OData Gateway Part 1: OData Basics and Your First SEGW ServiceLearn what OData is and why SAP uses it for Fiori and integrations, the building blocks (entity type, entity set, property, key, association, navigation), how a SEGW project generates MPC and DPC classes, and how to return data from GET_ENTITYSET with classic ABAP.
  • OData Gateway Part 2: SEGW vs RAP — Two Ways to Build ODataCompare the classic SEGW approach (code-based DPC_EXT, referenced data sources, mapped CDS) with RAP (CDS + behavior definition + service definition + service binding), including the obsolete @OData.publish shortcut, and decide which to use on a given system and project.
  • OData Gateway Part 3: $expand, Navigation, Deep Insert and $batchHandle related data in SEGW services: associations and navigation properties, navigation reads in GET_ENTITYSET, $expand via GET_EXPANDED_ENTITY, deep insert of header with items via CREATE_DEEP_ENTITY, and $batch with changesets and commit rules.
  • OData Gateway Part 4: Gateway Architecture — Hub vs EmbeddedUnderstand how SAP Gateway is split into a frontend (IWFND, service registration, HTTP handling) and a backend (IWBEP, your MPC/DPC code), how hub and embedded deployments differ, how system aliases and trusted RFC connect them, and what SAP recommends for S/4HANA.
  • OData Gateway Part 5: Service Registration, $metadata and Gateway Client TestingMake a SEGW service reachable: activate it in /IWFND/MAINT_SERVICE with a system alias, check the ICF node, read $metadata, test all CRUD operations in the Gateway client /IWFND/GW_CLIENT, clear metadata caches and transport the registration.
  • OData Gateway Part 6: GET_ENTITY and Key HandlingImplement single-entity reads in SEGW: read keys from it_key_tab or converted keys, apply ALPHA conversion, handle composite and date keys, return 404 for missing entities, check authorization, and avoid the typical key mismatches between $metadata, URL and database.
  • OData Gateway Part 7: GET_ENTITYSET with Filters, Paging and SortingImplement production-grade list reads: translate $filter into SELECT-OPTIONS-like ranges, apply $top/$skip paging in the database, map $orderby to a dynamic ORDER BY, return $inlinecount/$count, handle $search, and avoid reading everything and filtering in ABAP.
  • OData Gateway Part 8: CREATE_ENTITY, UPDATE_ENTITY and DELETE_ENTITYImplement write operations in SEGW: read the payload with read_entry_data, validate, lock, create/update/delete through BAPIs or Z-table logic, return the created entity, handle PUT vs PATCH/MERGE, HTTP status codes, CSRF tokens and commit rules.
  • OData Gateway Part 9: Error Handling and the Message ContainerReturn meaningful errors from Gateway services: business vs technical exceptions and their HTTP status codes, the message container for BAPI and T100 messages, leading messages and error details, success and warning messages in the sap-message header, and what Fiori shows to the user.
  • OData Gateway Part 10: Debugging OData ServicesDebug Gateway services end to end: external (HTTP) breakpoints for the right user and system, /IWFND/ERROR_LOG and /IWBEP/ERROR_LOG with replay, payload traces in /IWFND/TRACES, the browser network tab, sap-statistics for timing, application logging in DPC_EXT, and a systematic workflow from symptom to root cause.

Interview questions covered

  • How do you implement $filter on an entity set?
  • A Fiori app calls your OData service but your breakpoint is not stopping. What would you check?
  • An OData list service is slow and returns thousands of records. How would you improve it?
  • What is the difference between entity type and entity set in OData?
  • What is a deep insert?
  • A material detail service returns not found for material 12345, but the material exists in SAP. What could be wrong?
  • External partner requires OAuth2 on OData. Approach?
  • How do you design a maintainable SEGW OData service?
  • What is OData?
  • Where do you check errors for a failing OData service?
  • OData call returns 500 error with no useful message. What do you check?
  • How would you expose a custom entity to Fiori using SEGW?
  • When would you choose RAP/CDS OData over classic SEGW?
  • A service works in /IWFND/GW_CLIENT on the backend but fails from the Fiori launchpad on the frontend server with "No system alias found". What is happening?
  • A sales order service uses MESSAGE e001(zsales) for validation in DPC_EXT. Fiori users get a short dump or a generic error. How do you fix error handling?
  • A stable SEGW OData V2 API is used by three external partners. A new architect wants to rewrite it in RAP "because SEGW is old". How do you evaluate this?
  • A Fiori list shows customers correctly, but the object page is empty for every customer. The list returns Customer = '12345'. What is likely wrong?
  • An invoice list service returns every billing document when no filter is sent and times out in Fiori. How do you fix it?
  • Users scrolling a Fiori list see some orders twice and others never. The service implements $top/$skip. What is the cause?
  • A developer proposes adding @OData.publish: true to a CDS view to quickly expose it. What do you advise on a current S/4HANA system?

Related topics

Interview questions on this topic