SAP Gateway
RAP / CDS / ODataintermediate

SAP Gateway Part 1: Gateway as the ABAP OData Runtime

Key takeaway

Understand SAP Gateway as the ABAP OData runtime: what it does, embedded vs hub deployment, how RAP and SEGW services both run on it, and which Gateway components you touch as a developer.

What this complete series covers

Learn Gateway in a clear, practical sequence — from the basic idea to real project use, troubleshooting, and interview-ready understanding.

Who it is for
Best for SAP consultants, developers, and learners who want a practical understanding of Gateway.
Prerequisites
Basic ABAP and ADT in Eclipse are recommended. The series explains the RAP/CDS/OData concepts as they are introduced.
Final outcome
By the end, you should be able to explain Gateway clearly, follow the main end-to-end flow, apply it in a project scenario, and troubleshoot the most common issues.
  1. Part 1: SAP Gateway Part 1: Gateway as the ABAP OData Runtime

    Understand SAP Gateway as the ABAP OData runtime connecting HTTP consumers to backend business logic, including service registration, ICF/runtime layers and hub versus embedded deployment concepts.

  2. Part 2: SAP Gateway Part 2: Frontend, Backend and Request Flow

    Understand how SAP Gateway receives an OData request, resolves the service, executes backend logic and returns an HTTP response so troubleshooting starts at the correct layer.

  3. Part 3: SAP Gateway Part 3: SEGW Model, Registration, Metadata and Transports

    Manage classic Gateway services through design, generated extension classes, service registration, metadata validation and transport without editing generated code or relying on local manual fixes.

  4. Part 4: SAP Gateway Part 4: Paging, Filtering, CSRF and Authorization

    Operate Gateway services securely and efficiently by enforcing backend authorization, honoring filters and paging, using CSRF protection for state changes and controlling payload/round-trip size.

System and release assumptions: Examples target recent SAP S/4HANA / ABAP Cloud capabilities. RAP, CDS, OData, and Fiori Elements syntax and tooling can differ by ABAP platform release.

Explanation

📌 KEY POINTS
✅ SAP Gateway is the ABAP framework that receives OData HTTP requests and routes them to service implementations.

✅ Deployment: embedded (Gateway in the S/4HANA system) or hub (separate frontend server).

✅ Both RAP services and classic SEGW services run on Gateway infrastructure.

💡 For new development, RAP generates the service; SEGW knowledge is mainly for existing services.

━━━━━━━━━━━━━━━━━━━━
▶ WHAT THIS SERIES COVERS

  • Part 1 — Gateway as the ABAP OData runtime (this lesson)
  • Part 2 — frontend, backend and request flow
  • Part 3 — SEGW model, registration, metadata and transports
  • Part 4 — paging, filtering, CSRF and authorization

━━━━━━━━━━━━━━━━━━━━
▶ 1. WHAT GATEWAY DOES

  • Receives HTTP requests on the ICF (Internet Communication Framework).
  • Parses OData (URL, query options, payload), handles CSRF, content negotiation and $batch.
  • Finds the service and its backend system.
  • Calls the service implementation: RAP business object/query or SEGW data provider class (DPC_EXT).
  • Builds the OData response and $metadata; caches metadata.
  • Logs errors and offers traces.

━━━━━━━━━━━━━━━━━━━━
▶ 2. COMPONENT NAMES YOU WILL SEE

  • Frontend / hub components: namespace /IWFND/ (e.g. /IWFND/MAINT_SERVICE, /IWFND/ERROR_LOG).
  • Backend components: namespace /IWBEP/ (e.g. /IWBEP/ERROR_LOG, SEGW runtime classes).
  • In S/4HANA both are part of the SAP_GWFND software component.

━━━━━━━━━━━━━━━━━━━━
▶ 3. DEPLOYMENT OPTIONS

  • Embedded: Gateway frontend and backend in the same S/4HANA system. Simpler, fewer systems, direct access. Common in S/4HANA landscapes.
  • Hub: a separate frontend server (often also running the Fiori launchpad) that routes to one or more backends via system aliases (RFC). Useful for central UI management, several backends, or separate UI lifecycle.

The choice affects where you register services, where logs are, and where caches must be cleaned.

━━━━━━━━━━━━━━━━━━━━
▶ 4. RAP VS SEGW ON GATEWAY

  • RAP: you define CDS, BDEF, service definition and binding; the binding publishes the service to Gateway. OData V4 and V2.
  • SEGW: you model entity types in SEGW, generate MPC/DPC classes, implement CRUD in DPC_EXT, register the service. OData V2 (V4 via other classic frameworks is rare).
  • Same runtime tools for both: error logs, GW client, traces.

━━━━━━━━━━━━━━━━━━━━
▶ 5. WHY IT STILL MATTERS

Most S/4HANA landscapes contain hundreds of SEGW services and standard V2 services. Support, performance tuning and migration to RAP need Gateway knowledge.

━━━━━━━━━━━━━━━━━━━━
▶ STEP BY STEP

  1. Find out whether your system is embedded or hub (ask basis, or check system aliases in /IWFND/MAINT_SERVICE).
  2. Open /IWFND/MAINT_SERVICE and locate one RAP and one SEGW service.
  3. Open the error log and GW client and run a request.

✅ CHECKPOINT: you know where Gateway sits and which tools belong to it.

Code example

ABAP Code
" ===== Gateway landscape at a glance =====""  EMBEDDED                                   HUB"  Browser / API client                       Browser / API client"        |  HTTPS                                   |  HTTPS"  +-----v------------------------+           +-----v-----------------+"  | S/4HANA                      |           | Gateway hub (Fiori FE)|"  |  ICF -> /IWFND (frontend)    |           |  ICF -> /IWFND        |"  |        -> /IWBEP (backend)   |           |  system alias (RFC)   |"  |        -> RAP BO / DPC_EXT   |           +-----------+-----------+"  +------------------------------+                       | RFC"                                             +-----------v-----------+"                                             | S/4HANA backend       |"                                             |  /IWBEP -> DPC_EXT    |"                                             +-----------------------+ " ===== Where things live =====" Item                         Embedded          Hub" Service registration         same system       hub (/IWFND/MAINT_SERVICE)" System alias                 LOCAL             alias -> backend RFC" Frontend error log           same system       hub (/IWFND/ERROR_LOG)" Backend error log            same system       backend (/IWBEP/ERROR_LOG)" Metadata cache cleanup       both txns         hub + backend " ===== Two ways a service reaches Gateway =====" RAP : service definition -> service binding -> Publish       (V4 / V2)" SEGW: model -> generate MPC/DPC -> implement DPC_EXT -> register (V2)

Real project scenario

A team's Fiori app failed after go-live with RFC errors, while it had worked in QAS. Production used a hub deployment; QAS was embedded. The service was registered on the hub but with the system alias of the wrong backend client.
Once the team understood the hub architecture, they corrected the system alias in /IWFND/MAINT_SERVICE and cleaned both caches. They documented the deployment option of every landscape system, so that registration and troubleshooting steps matched the environment.

Common mistakes

  • Not knowing whether the landscape is embedded or hub.
  • Looking for logs or caches on the wrong system.
  • Wrong system alias in hub scenarios.
  • Assuming RAP services do not use Gateway.
  • Building new services with SEGW without a reason.

Best practices

  • Document the Gateway deployment option per system.
  • Know /IWFND (frontend) vs /IWBEP (backend) tools.
  • Use RAP for new services; maintain SEGW services knowingly.
  • Check system aliases after system copies and go-lives.
  • Use the same troubleshooting tools for RAP and SEGW services.

Interview angle

Questions: "What is SAP Gateway?", "Embedded vs hub deployment?", "How do RAP and SEGW relate to Gateway?"
Strong answer: Gateway is the ABAP OData runtime — ICF entry, OData parsing, CSRF, $batch, routing to implementations, metadata and logs; /IWFND is the frontend and /IWBEP the backend part. Embedded runs both in S/4HANA; hub uses a separate frontend server with system aliases to backends. RAP publishes services via bindings, SEGW via generated MPC/DPC and registration — both on Gateway.

Practice this lesson

Quick check

1. In a hub deployment, what connects the gateway frontend to the right backend?

2. What characterizes an embedded SAP Gateway deployment?

3. Which tool records the payload of requests for one specific user to analyze an intermittent issue?

Interview questions

1. What is SAP Gateway, and how do embedded and hub deployments differ?

Answer it in your own words first, then compare.

2. When would you still use SEGW today, and how do you keep SEGW services maintainable?

Answer it in your own words first, then compare.

Practice more with Interview AI →

Reference-verified: the steps are checked against official SAP documentation and tutorials, and object and field names in the sample code are checked for consistency. The code has not been compiled or run on an SAP system by ERPClimb. Syntax marked release-dependent varies by SAP release, so check it in your own system.

More lessons in this topic

Interview questions on this topic

Related SAP topics