ERPClimb logoERPClimb
OData Gateway
Architect / Cross-trackintermediate 7 min read

OData Gateway Part 5: Service Registration, $metadata and Gateway Client Testing

Preview · a free account unlocks the full lesson

Key takeaway

Make 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.

In this lessonShow sections

Visual overview

OData Gateway Part 5: Service Registration, $metadata and Gateway Client Testing — learning sheetFlow: Activate ZSALES_SRV in /IWFND/MAINT_SERVICE with the correct alias → Open $metadata and verify keys and types → In /IWFND/GW_CLIENT run GET SalesOrderSet?$format=json → Change a property length in SEGW, regenerate, observe stale metadata, then clean caches. Key ideas: ACTIVATION; $METADATA; GATEWAY CLIENT (/IWFND/GW_CLIENT); CACHES. Watch out: After model changes, stale metadata caches cause "property not found" errors — clean caches with /IWFND/CACHE_CLEANUP and /IWBEP/CACHE_CLEANUP.ERPClimb.com / ARCH / LESSON 5/10 / LEARNING SHEETOData Gateway Part 5: Service Registration, $metadata andGateway Client Testing1 · HOW IT FLOWS1ActivateZSALES_SRV in/IWFND/MAINT_SERVICE…2Open $metadataand verify keysand types3In/IWFND/GW_CLIENTrun GET…4Change aproperty lengthin SEGW…2 · KEY IDEAS EXPLAINEDActivation/IWFND/MAINT_SERVICE → Add Service → system alias(LOCAL in embedded) → filter by technical servicename (ZSALES_SRV) → Add Selected Services →…This creates the frontend registration and the ICFnode /sap/opu/odata/sap/ZSALES_SRV.$MetadataURL: /sap/opu/odata/sap/ZSALES_SRV/$metadataVerify: entity sets, key properties, EDM types,lengths, navigation properties,sap:creatable/updatable flags.Gateway Client (/IWFND/GW_CLIENT)Enter request URI, choose HTTP method, execute.GET with $format=json for readable output.CachesFrontend and backend cache the metadata.After regenerating MPC: /IWBEP/CACHE_CLEANUP(backend), /IWFND/CACHE_CLEANUP (frontend), or"Cleanup Cache" in MAINT_SERVICE.3 · REMEMBER · WATCH OUTRememberGenerating runtime objects registers the service in the backend; itmust also be activated on the frontend in /IWFND/MAINT_SERVICE (Add…$metadata shows what clients will see: entity types, keys, properties,navigation. Read it before coding any consumer./IWFND/GW_CLIENT tests GET, POST, PUT, PATCH/MERGE, DELETE and $batchinside SAP, with CSRF tokens and payload templates.!Watch outAfter model changes, stale metadatacaches cause "property notfound" errors — clean cacheswith /IWFND/CACHE_CLEANUP and/IWBEP/CACHE_CLEANUP.4 · IN A REAL PROJECTAfter adding a field DeliveryDate to an entity, the Fiori app failed with "Property DeliveryDate notfound". The developer re-checked MPC_EXT and DPC_EXT for a day. $metadata in the browser still showed theold model — the frontend was serving a cached version. Running /IWBEP/CACHE_CLEANUP and /IWFND/CACHE_CLEANUP…Original ERPClimb learning sheet • Verify against your SAP release and edition

Explanation

Part 4 explained the frontend/backend split; now we make the service reachable and actually test it. Generating runtime objects registers the service in the backend, but it also needs to be activated on the frontend in /IWFND/MAINT_SERVICE: Add Service, pick the system alias (LOCAL in an embedded deployment), filter by the technical service name (ZSALES_SRV), and Add Selected Services into a transportable package. This creates the frontend registration and the ICF node /sap/opu/odata/sap/ZSALES_SRV, which you should also confirm is active in SICF.

$metadata is what shows clients what they'll actually see — entity types, keys, properties, and navigation — and it's worth reading at /sap/opu/odata/sap/ZSALES_SRV/$metadata before coding any consumer against the service. Check the entity sets, key properties, EDM types and lengths, navigation properties, and the sap:creatable/updatable flags; the service document at the root URL simply lists the entity sets.

The Gateway Client (/IWFND/GW_CLIENT) lets you test GET, POST, PUT, PATCH/MERGE, DELETE, and $batch directly inside SAP: enter the request URI, choose the HTTP method, and execute — adding $format=json to a GET gives readable output.

For POST, PUT, or DELETE, you first GET with header x-csrf-token: Fetch and then send that token (most releases handle this automatically in the client), and "Use as Request" lets you copy a response straight into the next request body. Test cases built this way can be saved in the Gateway client for regression testing.

Free account

Create a free account to keep reading

You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.

  • Full explanation
  • Code example
  • Real project scenario
  • Common mistakes
  • Best practices
  • Interview angle

One tap with Google works too. Every topic keeps its first lesson open to everyone.

Keep exploring

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.