ERPClimb logoERPClimb
SAP Gateway
RAP / CDS / ODataintermediate 9 min read

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

Preview · a free account unlocks the full lesson

Key takeaway

Walk through the SEGW service lifecycle: model entity types and sets, generate MPC and DPC classes, implement DPC EXT, register the service in /IWFND/MAINT SERVICE, check metadata, and transport everything consistently.

In this lessonShow sections

Visual overview

SAP Gateway Part 3: SEGW Model, Registration, Metadata and Transports — learning sheetFlow: Create a small SEGW project with one entity set → Generate, redefine GET_ENTITYSET in DPC_EXT → Register in /IWFND/MAINT_SERVICE; test in GW client → Add a property; regenerate; clean cache; verify $metadata. Key ideas: MODEL IN SEGW; GENERATE RUNTIME ARTIFACTS; IMPLEMENT DPC_EXT; REGISTER AND ACTIVATE. Watch out: Transport SEGW project, classes AND the service registration — missing one breaks QAS/PRD.ERPClimb.com / RAP / LESSON 3/4 / LEARNING SHEETSAP Gateway Part 3: SEGW Model, Registration, Metadata andTransports1 · HOW IT FLOWS1Create a smallSEGW projectwith one entity…2Generate,redefineGET_ENTITYSET in…3Register in/IWFND/MAINT_SERVICE;test in GW…4Add a property;regenerate;clean cache…2 · KEY IDEAS EXPLAINEDModel In SEGWCreate project ZPURCHREQ (package, description).Data Model: entity types (PurchaseRequest,PurchaseRequestItem) with properties, keys, andflags (creatable, updatable, filterable…Generate Runtime ArtifactsZCL_ZPURCHREQ_MPC and ZCL_ZPURCHREQ_MPC_EXT —model provider (metadata).ZCL_ZPURCHREQ_DPC and ZCL_ZPURCHREQ_DPC_EXT — dataprovider (CRUD methods).Implement DPC_EXTRedefine the methods you need: GET_ENTITYSET,GET_ENTITY, CREATE_ENTITY, UPDATE_ENTITY,DELETE_ENTITY, CREATE_DEEP_ENTITY, EXECUTE_ACTION…Register And Activate/IWFND/MAINT_SERVICE → Add Service → system alias(LOCAL for embedded) → find ZPURCHREQ_SRV → addwith a package and transport.This creates the ICF node and the service entry(with version).3 · REMEMBER · WATCH OUTRememberSEGW flow: model → generate runtime artifacts (MPC, DPC, *_EXT) →implement DPC_EXT → register → test.Only change the *_EXT classes; generated base classes are overwrittenon regeneration.Register the service in /IWFND/MAINT_SERVICE (on the hub in hubscenarios) with the right system alias.!Watch outTransport SEGW project, classes ANDthe service registration — missingone breaks QAS/PRD.4 · IN A REAL PROJECTA SEGW service worked in DEV but returned 404 in QAS. The classes and project had been transported, but theservice registration created in /IWFND/MAINT_SERVICE was saved as a local object in DEV, so QAS had no serviceentry. The team registered the service with a transport, imported it, cleaned the metadata caches and verified…Original ERPClimb learning sheet • Verify against your SAP release and edition

Explanation

The SEGW flow runs from modeling, through generating runtime artifacts (MPC, DPC and their _EXT classes), to implementing DPC_EXT, registering the service, and finally testing it. Only the *_EXT classes should ever be changed, since the generated base classes get overwritten on regeneration. The service is registered in /IWFND/MAINT_SERVICE — on the hub in hub scenarios — with the correct system alias, and the SEGW project, its classes, and the service registration all need to be transported together, since missing any one of them breaks QAS or PRD.

Parts 1 and 2 explained the Gateway runtime; this part shows how a classic SEGW service is actually built and moved through the landscape. For new development you'd use RAP instead — this knowledge is specifically for maintaining services that already exist.

Modeling in SEGW starts with creating a project, such as ZPURCHREQ, with its own package and description. In the Data Model view you define entity types — PurchaseRequest, PurchaseRequestItem — along with their properties, keys, and flags like creatable, updatable, filterable and sortable, plus entity sets, associations, navigation properties and function imports. You can model from a DDIC structure, from an RFC or BAPI, or build it manually.

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.