# SAP Gateway OData Transaction Codes Reference

> Source: https://netray.co/tools/sap-gateway-odata-transaction-codes-reference
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Free Tools

## Short answer

Every Gateway transaction you need to build, activate, test and debug OData services, with where it runs (hub or backend) and the mistake people make with it.

## Category

sap

## Erp

SAP NetWeaver / Basis

## Audience

- SAP Basis administrator
- ABAP developer
- Fiori administrator

## Tool

**Kind:** worksheet

**Mode:** reference

**Columns:**

#### Transaction

**Key:** tcode

**Type:** text

#### Hub or backend

**Key:** side

**Type:** text

#### Purpose

**Key:** purpose

**Type:** text

#### When you use it

**Key:** when

**Type:** text

#### Gotcha

**Key:** gotcha

**Type:** text

**Rows:**

**Tcode:** SEGW

**Side:** Backend (IWBEP)

**Purpose:** Gateway Service Builder: model entities, import DDIC or RFC, generate runtime artifacts

**When:** Building or changing an OData V2 service

**Gotcha:** Code goes in the *_DPC_EXT and *_MPC_EXT classes; the base classes are regenerated.

**Tcode:** /IWFND/MAINT_SERVICE

**Side:** Hub (IWFND)

**Purpose:** Activate and maintain OData V2 services: add service, system alias, ICF node

**When:** After generating a service, or to check why a service is not found

**Gotcha:** Embedded deployment uses system alias LOCAL; on a hub pick the backend alias.

**Tcode:** /IWFND/GW_CLIENT

**Side:** Hub (IWFND)

**Purpose:** Gateway client to send OData requests with headers and payloads

**When:** Testing GET, POST, $batch and $metadata without a browser

**Gotcha:** Fetch an X-CSRF-Token with a GET first for write requests from outside the client.

**Tcode:** /IWFND/ERROR_LOG

**Side:** Hub (IWFND)

**Purpose:** Gateway error log with request, response and call stack

**When:** First stop for HTTP 400 and 500 errors from a Fiori app

**Gotcha:** Use Replay to send the failed request to the Gateway client.

**Tcode:** /IWBEP/ERROR_LOG

**Side:** Backend (IWBEP)

**Purpose:** Backend error log for the business logic side

**When:** Hub log points to a backend error

**Gotcha:** On a hub setup log on to the backend system to read it.

**Tcode:** /IWFND/APPS_LOG

**Side:** Hub (IWFND)

**Purpose:** Gateway application log

**When:** Messages written during service processing

**Gotcha:** Equivalent to SLG1 with object /IWFND/; on backend use SLG1 with object /IWBEP/.

**Tcode:** /IWFND/TRACES

**Side:** Hub (IWFND)

**Purpose:** Payload and performance trace for a user or request URI

**When:** Capturing what an app really sends, timing per step

**Gotcha:** Traces are switched on for a limited time; switch them off after use.

**Tcode:** /IWFND/STATS

**Side:** Hub (IWFND)

**Purpose:** Gateway performance statistics per service

**When:** Finding slow services and the share of hub vs backend time

**Gotcha:** Shows aggregated data; use /IWFND/TRACES for a single request.

**Tcode:** /IWFND/CACHE_CLEANUP

**Side:** Hub (IWFND)

**Purpose:** Clean the metadata (model) cache on the hub

**When:** After model changes, when $metadata still shows old fields

**Gotcha:** Clean the backend cache as well in a hub setup.

**Tcode:** /IWBEP/CACHE_CLEANUP

**Side:** Backend (IWBEP)

**Purpose:** Clean the backend metadata cache

**When:** After transporting model changes

**Gotcha:** Run on the backend client used by the service.

**Tcode:** /IWFND/V4_ADMIN

**Side:** Hub (IWFND)

**Purpose:** Publish OData V4 service groups and assign them to a system alias

**When:** Activating V4 services, including RAP V4 bindings

**Gotcha:** V4 services are published as service groups, not in /IWFND/MAINT_SERVICE.

**Tcode:** /IWBEP/V4_ADMIN

**Side:** Backend (IWBEP)

**Purpose:** Register OData V4 service groups on the backend

**When:** Hub deployment of V4 services

**Gotcha:** Register on backend first, then publish on the hub.

**Tcode:** /IWBEP/REG_SERVICE

**Side:** Backend (IWBEP)

**Purpose:** Register a technical service and assign its model

**When:** Services built without SEGW registration or after a broken assignment

**Gotcha:** Model name and version must match the registered model.

**Tcode:** /IWBEP/REG_MODEL

**Side:** Backend (IWBEP)

**Purpose:** Maintain registered models

**When:** Checking that a valid model exists for a service

**Gotcha:** A service with a missing model fails at $metadata.

**Tcode:** /IWFND/IWF_ACTIVATE

**Side:** Hub (IWFND)

**Purpose:** Activate SAP Gateway

**When:** Initial setup of a Gateway system

**Gotcha:** Usually done once by Basis; a deactivated Gateway rejects all OData calls.

**Tcode:** STC01

**Side:** Both

**Purpose:** Task manager for technical configuration, e.g. task list SAP_GATEWAY_BASIC_CONFIG

**When:** Basic Gateway setup on a new system

**Gotcha:** Read the log of each task; some steps need manual follow-up.

**Tcode:** SICF

**Side:** Hub

**Purpose:** ICF nodes: /sap/opu/odata for V2 and /sap/opu/odata4 for V4

**When:** Service returns HTTP 403 or 404 at the ICF layer

**Gotcha:** A service can be active in MAINT_SERVICE while its ICF node is inactive.

**Tcode:** SPRO

**Side:** Hub

**Purpose:** SAP NetWeaver > SAP Gateway > OData Channel > Configuration > Connection Settings > SAP Gateway to SAP System > Manage SAP System Aliases

**When:** Defining the alias that points a hub to a backend

**Gotcha:** The alias RFC destination must exist and work in SM59.

**Tcode:** SM59

**Side:** Hub

**Purpose:** RFC destination from hub to backend, typically trusted

**When:** Hub deployment setup and logon errors

**Gotcha:** Trusted RFC needs trust relationship (SMT1) and authorization S_RFCACL.

**Tcode:** PFCG

**Side:** Both

**Purpose:** Roles with start authorization S_SERVICE for the service

**When:** HTTP 403 for a user while the admin can call the service

**Gotcha:** Hub roles use TADIR type R3TR IWSG; backend roles use R3TR IWSV.

**Tcode:** SLG1

**Side:** Both

**Purpose:** Application log, object /IWFND/ on hub and /IWBEP/ on backend

**When:** Reading Gateway application logs with standard tools

**Gotcha:** Log level is set in SPRO under the OData Channel administration settings.

**Notes:** Transactions follow the SAP Gateway Foundation documentation for NetWeaver 7.50 and ABAP Platform. In embedded deployment IWFND and IWBEP run in one system, so both prefixes work there.

## Content

**Intro:** This reference lists the SAP Gateway transactions used to build, activate, test and troubleshoot OData services, with whether each runs on the hub (IWFND) or the backend (IWBEP). It applies to SAP NetWeaver 7.4 and 7.5, S/4HANA embedded Gateway and separate hub systems.

**Sections:**

#### Where this lives in SAP

**Body:** Gateway has two layers. IWBEP is the backend framework where the model and data provider classes live, built in SEGW or generated from CDS or RAP. IWFND is the hub that exposes services through ICF under /sap/opu/odata and routes calls to a backend through a system alias. In embedded deployment, common with S/4HANA, both run in one system and the alias is LOCAL. In hub deployment the IWFND transactions run on the Gateway system and the IWBEP ones on the ERP backend, connected by an RFC destination.

**Bullets:**

- OData V2: activate in /IWFND/MAINT_SERVICE.
- OData V4: publish service groups in /IWFND/V4_ADMIN.
- Logs: /IWFND/ERROR_LOG on hub, /IWBEP/ERROR_LOG on backend.

#### How to activate an OData service

**Body:** Generate the runtime objects in SEGW. Then in /IWFND/MAINT_SERVICE choose Add Service, enter the system alias (LOCAL for embedded), find the technical service name and add it with a package. Check that the ICF node under /sap/opu/odata is active in SICF and that users have a role with the service authorization. Test with /IWFND/GW_CLIENT using /sap/opu/odata/sap/SERVICE_NAME/$metadata. For a V4 service or a RAP V4 binding, publish the service group in /IWFND/V4_ADMIN instead.

#### Worked example: Fiori app shows an error

**Body:** A user reports an HTTP 500 in an app. Open /IWFND/ERROR_LOG, filter on the user and time, and read the error text and the call stack. If it says the error came from the backend, read /IWBEP/ERROR_LOG on that system. Use Replay to send the request to the Gateway client and reproduce it with a breakpoint in the DPC_EXT method. If $metadata still shows an old field after a transport, clean the caches with /IWFND/CACHE_CLEANUP and /IWBEP/CACHE_CLEANUP. An HTTP 403 points to missing S_SERVICE authorization: check with SU53.

#### Common mistakes

**Body:** People add the service in MAINT_SERVICE but forget the ICF node or the role, or add it with the wrong system alias on a hub. Code written in the generated base classes is lost at the next generation. Traces in /IWFND/TRACES are left switched on. Model caches are cleaned on the hub only. V4 services are searched for in MAINT_SERVICE, where they do not appear. Roles are built for the backend service type IWSV when the start check runs on the hub against IWSG.

**Cta:** If you want your team to ask SAP questions in plain English through your own Gateway services, on your own servers, Netray can build that AI layer.

**Faq:**

#### What is the tcode for the SAP Gateway client?

**Answer:** /IWFND/GW_CLIENT. It sends OData requests to services activated on the hub, with editable headers and payloads, and can save requests. Use it to test $metadata, GET with $filter, POST and $batch calls. Failed requests from /IWFND/ERROR_LOG can be replayed into it.

#### Where is the error log for an OData service?

**Answer:** On the hub or embedded system use /IWFND/ERROR_LOG. Backend errors in a hub deployment are in /IWBEP/ERROR_LOG on the backend. Application log messages are in /IWFND/APPS_LOG or SLG1 with object /IWFND/ (hub) or /IWBEP/ (backend).

#### How do I activate an OData service in SAP?

**Answer:** For V2, use /IWFND/MAINT_SERVICE, choose Add Service, enter the system alias, find the service and add it. Make sure its ICF node is active and users have the S_SERVICE authorization. For V4, publish the service group in /IWFND/V4_ADMIN.

#### Why does $metadata not show my new field?

**Answer:** The model is cached. After changing the model or transporting it, run /IWFND/CACHE_CLEANUP on the hub and /IWBEP/CACHE_CLEANUP on the backend, then reload $metadata. Also check that the runtime artifacts were regenerated in SEGW.

## Search terms

sap odata gateway tcode, tcode for odata sap gateway client, sap gateway odata service tcode, sap odata error log, error log in odata service sap, how to activate odata services in sap, iwfnd maint_service

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
