SAP Gateway Part 1: Gateway as the ABAP OData Runtime
Free sample lesson · open to everyone
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.
In this lessonShow sectionsHide sections
Visual overview
Expert visual walkthrough
Gateway as the ABAP OData Runtime
SAP Gateway · Chapter-specific technical teaching map
Integration path
API client
OData contract
Gateway / RAP runtime
HTTP response
Tutor's chapter 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.
In a real project
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…
Watch out for
• 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…
The situation: a 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.
Explanation
SAP Gateway is the ABAP framework that receives OData HTTP requests and routes them to the actual service implementations. It can be deployed embedded, inside the S/4HANA system itself, or as a hub, running on a separate frontend server. Both RAP services and classic SEGW services run on the same Gateway infrastructure. For new development, RAP generates the service for you; SEGW knowledge mainly matters for maintaining services that already exist.
This series covers Gateway across four parts: Part 1, this lesson, on Gateway as the ABAP OData runtime; Part 2 on frontend, backend and request flow; Part 3 on the SEGW model, registration, metadata and transports; and Part 4 on paging, filtering, CSRF and authorization.
Gateway's job breaks down into several steps. It receives HTTP requests through the ICF (Internet Communication Framework). It parses the OData request — the URL, query options, payload — and handles CSRF, content negotiation and $batch. It finds the right service and its backend system. It calls the actual service implementation, whether that's a RAP business object or query, or a SEGW data provider class (DPC_EXT). It builds the OData response and $metadata, caching that metadata along the way. And it logs errors and makes traces available.
Along the way you'll run into two sets of component names. Frontend, or hub, components live under the /IWFND/ namespace, such as /IWFND/MAINT_SERVICE or /IWFND/ERROR_LOG. Backend components live under the /IWBEP/ namespace, such as /IWBEP/ERROR_LOG and the SEGW runtime classes. In S/4HANA, both sets belong to the SAP_GWFND software component.
There are two deployment options. Embedded deployment puts the Gateway frontend and backend in the same S/4HANA system, which is simpler, involves fewer systems, and gives direct access — this is common in S/4HANA landscapes.
Hub deployment uses a separate frontend server, often also running the Fiori launchpad, which routes to one or more backends through system aliases over RFC — useful for central UI management, serving several backends, or keeping the UI on a separate lifecycle.
Which one you have affects where you register services, where the logs live, and where caches need to be cleaned.
RAP and SEGW both sit on Gateway, but work differently. With RAP, you define CDS, a BDEF, a service definition and a binding, and the binding publishes the service to Gateway, supporting both OData V4 and V2. With SEGW, you model entity types directly in SEGW, generate MPC and DPC classes, implement CRUD in DPC_EXT, and register the service — this covers OData V2, since OData V4 through other classic frameworks is rare. Both approaches share the same runtime tools: error logs, the GW client, and traces.
This still matters because most S/4HANA landscapes contain hundreds of SEGW services and standard V2 services alongside newer RAP ones. Supporting them, tuning their performance, and eventually migrating them to RAP all require real Gateway knowledge.
To get oriented: find out whether your system is embedded or hub, either by asking basis or by checking the system aliases in /IWFND/MAINT_SERVICE; open /IWFND/MAINT_SERVICE and locate one RAP service and one SEGW service; and open the error log and the GW client and run a request through each.
With this you know where Gateway sits in the landscape and which tools belong to it.
Code example
" ===== 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)Watch out
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.
Do this
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.
In the interview
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
0 of 3 questions attempted
Question 1 of 3
In a hub deployment, what connects the gateway frontend to the right backend?
Question 2 of 3
What characterizes an embedded SAP Gateway deployment?
Question 3 of 3
Which tool records the payload of requests for one specific user to analyze an intermittent issue?
Practise this in an interview
Answer in your own words and get instant feedback, the way an interviewer would judge it.
1What is SAP Gateway, and how do embedded and hub deployments differ?
2When would you still use SEGW today, and how do you keep SEGW services maintainable?
See it in code
Each example starts from a requirement, shows the design, then the code step by step with a plain-language explanation of every part.
Was this lesson helpful?
Keep exploring
Interview questions on this topic
Referenced SAP objects
Reviewed reference pages for the objects this page mentions.
Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.