Data & Services

SAP Gateway

SAP Gateway is the ABAP framework that exposes OData services from SAP systems such as SAP S/4HANA and SAP ERP, handling service registration, routing, authorization checks and error logging for SAP Fiori apps. SAP Gateway runs either embedded in the backend system or on a separate hub system, a deployment choice with lasting operational consequences.

Quick facts

Type
ABAP framework for OData services (software component SAP_GWFND)
Layer
Services & APIs
Deployment options
Embedded (recommended for SAP S/4HANA) or hub
Key T-codes
/IWFND/MAINT_SERVICE, /IWFND/V4_ADMIN, /IWFND/ERROR_LOG, /IWBEP/ERROR_LOG, /IWFND/GW_CLIENT
Who works with it
Basis administrators, ABAP developers, SAP Fiori support teams
Applies to
SAP S/4HANA on-premise and Private Edition, SAP ERP (ECC)
Layer: Services & APIsWhere it sits ▾
Where it sits: L4 · Services & APIsLayer: Services & APIs.L1L2L3L4L5L6BTP

Layer: Services & APIs

Open the architecture map →

How does SAP Gateway work?

SAP Gateway splits OData processing into a hub side and a backend side, which can run in the same system or in two systems:

  1. An SAP Fiori app sends an OData request to a URL under the ICF path for OData services.
  2. The hub component receives it, checks that the service is registered and active, and checks the user's start authorization for the service (authorization object S_SERVICE).
  3. The hub uses the service's system alias to route the request to the backend that implements it — the same system in an embedded setup, or a backend reached through an RFC connection in a hub setup.
  4. The backend component runs the service implementation: a RAP business object, CDS-based logic or the classes of a SEGW project.
  5. The response travels back the same way, and any error is written to the hub or backend error log.

SAP Gateway is therefore the traffic layer between SAP Fiori apps and ABAP business logic, not the place where that logic lives.

Should you choose embedded or hub deployment?

SAP documents two deployment options for SAP Gateway as part of the SAP Fiori front-end server:

Embedded deploymentHub deployment
Where services are registeredIn the backend system itselfOn a separate hub system
Connection to backendLocal (system alias LOCAL)RFC connection plus system alias
LifecycleUpgraded together with SAP S/4HANAUpgraded on its own schedule
SAP S/4HANA statusRecommended for new installationsDeprecated for SAP S/4HANA, to become obsolete in a later release

The hub option once gave central control over several backends and a separate upgrade cycle for the UI layer. For SAP S/4HANA, SAP now recommends the embedded deployment and has announced the deprecation of the standalone hub, which will become obsolete in a future release, with a documented migration path from standalone to embedded. Landscapes still serving older SAP ERP backends from one hub need a separate plan. For a new SAP S/4HANA system, the SAP Gateway deployment decision is effectively made: embedded.

Which transactions do SAP Gateway administrators use?

TaskTransaction
Register and activate OData V2 services, assign system aliases/IWFND/MAINT_SERVICE
Publish and manage OData V4 service groups/IWFND/V4_ADMIN
Analyze errors on the hub side/IWFND/ERROR_LOG
Analyze errors in the backend/IWBEP/ERROR_LOG
Send or replay test requests/IWFND/GW_CLIENT
Trace payloads and performance for a user/IWFND/TRACES
Clear the metadata cache after changes/IWFND/CACHE_CLEANUP and /IWBEP/CACHE_CLEANUP
Model and generate classic servicesSEGW (SAP Gateway Service Builder)
Activate ICF nodes and check RFC connectionsSICF and SM59

The /IWFND/ prefix belongs to the hub component and the /IWBEP/ prefix to the backend component; in an embedded deployment both sets run in the same system. Knowing which side a transaction belongs to is the fastest way to orient yourself in SAP Gateway.

Where does SAP Gateway apply across SAP S/4HANA editions and SAP BTP?

  • SAP S/4HANA on-premise and Private Edition: customers or their operations partner administer SAP Gateway directly, with the transactions above.
  • SAP ERP (ECC): SAP Gateway serves SAP Fiori apps for SAP ERP as well, often from a hub that also hosts the SAP Fiori Launchpad. Features depend on the SAP NetWeaver release; OData V4 exposure, for example, needs SAP NetWeaver 7.50 SP04 or higher.
  • SAP S/4HANA Cloud Public Edition: the SAP Gateway transactions in this entry are documented for on-premise and Private Edition systems; in Public Edition, APIs are exposed to other systems through communication arrangements.
  • SAP BTP: ABAP environment services are published through RAP service bindings and exposed to other systems through communication scenarios, and CAP serves OData itself, so the work happens in these tools rather than in the SAP Gateway transactions.

SAP Gateway is an administration topic mainly where the customer runs the ABAP stack.

How do you troubleshoot an SAP Gateway problem?

When an SAP Fiori app at Alder Manufacturing shows "no data" or a generic error, work through the layers in order:

  1. Find the failing request. In the browser developer tools, locate the OData call (often inside a $batch) and note the HTTP status and message.
  2. 401 or 403: check the user's start authorization for the service with SU53, and confirm the ICF node is active in SICF.
  3. 404 or "service not found": check the service registration and system alias in /IWFND/MAINT_SERVICE, or the service group in /IWFND/V4_ADMIN.
  4. 500 errors: open /IWFND/ERROR_LOG, then follow the entry into /IWBEP/ERROR_LOG for the backend cause.
  5. Behavior unchanged after a transport: clean up the metadata caches on both sides.
  6. Reproduce the request in /IWFND/GW_CLIENT to rule out the app.

A frequent complaint in practitioner communities is time lost debugging SAPUI5 code when the cause sat in configuration. Checking SAP Gateway layer by layer separates registration and authorization gaps from code defects.

SAP Gateway vs. OData: what is the difference?

SAP GatewayOData
What it isABAP framework and runtimeOpen protocol for data access over HTTP
Where it existsIn ABAP systems (SAP S/4HANA, SAP ERP)In any system that implements the protocol, including CAP on SAP BTP
Question it answersHow does an ABAP system expose and route a service?How does a client read and change the data?
Typical failureService not registered, wrong system alias, missing start authorizationMalformed query options, unsupported operation, version mismatch

OData defines the conversation; SAP Gateway is one of the runtimes that speaks it for ABAP systems.

FAQ

Is SAP Gateway the same as SAP NetWeaver Gateway?

Yes. SAP NetWeaver Gateway is the earlier product name. Current SAP documentation describes the framework as SAP Gateway Foundation, delivered in the ABAP software component SAP_GWFND, which is part of the ABAP platform underneath SAP S/4HANA.

Does SAP S/4HANA still support a central Gateway hub?

SAP has deprecated the hub deployment option of the SAP Fiori front-end server for SAP S/4HANA and recommends the embedded deployment, with a documented migration path. Existing hub landscapes keep working for now, but should plan the move before the option becomes obsolete.

Do SAP Fiori apps need SAP Gateway?

SAP Fiori apps that call OData services in an ABAP system such as SAP S/4HANA use SAP Gateway to reach those services. Apps whose services run on SAP BTP, for example with CAP, do not use the ABAP Gateway runtime.

What is a system alias in SAP Gateway?

A system alias tells SAP Gateway which backend system processes a registered service. In an embedded deployment the alias usually points to the local system, while in a hub deployment it points to a backend reached through an RFC connection.

Why does an OData service still return old metadata after a change?

SAP Gateway caches service metadata on the hub and backend sides. After transporting model changes, administrators clean up both caches with the cache cleanup transactions so that the SAP Fiori app receives the new metadata on its next request.

Sources

Applies to
SAP S/4HANA on-premise · SAP S/4HANA Cloud Private Edition · SAP ERP (ECC)
Last reviewed

SAP, SAP Fiori, SAPUI5, SAP S/4HANA, SAP BTP and other SAP products and services mentioned are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. This guide is independent and is not affiliated with, sponsored or endorsed by SAP SE.