All topics
RAP_CDS_ODATAadvanced

OData V2

intermediate

OData V2 Part 1: The Classic OData V2 Service Model

Understand the classic OData V2 service model you will meet in existing SAP landscapes: service document, $metadata, entity sets, associations and navigation, V2 query syntax, JSON format and how V2 differs from V4.

Real project relevance

A new developer familiar only with RAP V4 tried to add a filter to an old SEGW-based integration using contains(Description,'chair') and $count=true. The service returned errors, and he suspected a broken backend. A colleague showed him the V2 equivalents — substringof and $inlinecount=allpages — and the "d" wrapper in responses. The integration worked immediately. The team then added a V2/V4 cheat sheet to their wiki, since both protocols would coexist for years.

Open lesson page
intermediate

OData V2 Part 2: Deep Insert, Batch and Navigation Design

Design OData V2 navigation and write operations: associations and navigation properties, $expand, deep insert of header and items, $batch with change sets, and the implementation side in SEGW (CREATE_DEEP_ENTITY, changeset methods).

Real project relevance

A SEGW service accepted header and items in separate calls from a UI5 app. When item creation failed, headers without items remained, and users created them again — leading to duplicates and manual cleanup. The team implemented CREATE_DEEP_ENTITY with a single business-logic call and proper exception handling, so header and items were created together or not at all. For multi-step edits, changeset handling ensured one commit per changeset. Orphan headers disappeared.

Open lesson page
intermediate

OData V2 Part 3: Production Troubleshooting — Gateway Logs and Metadata

Troubleshoot OData V2 services in production: collect the right evidence, use /IWFND/ERROR_LOG, /IWBEP/ERROR_LOG, /IWFND/GW_CLIENT, /IWFND/TRACES and ST22, fix metadata cache issues, and resolve typical status codes.

Real project relevance

After a transport added a new field to a SEGW service, the Fiori app still did not show it in QAS. The team transported the service again twice. The field was present in the backend model, but the gateway hub served cached metadata. Running /IWFND/CACHE_CLEANUP on the hub and /IWBEP/CACHE_CLEANUP on the backend (plus a browser cache refresh) made the field appear immediately. "Clean metadata cache after model transports" was added to the deployment checklist.

Open lesson page

Interview questions covered

  • What are the main differences between OData V2 and V4 for an SAP developer?
  • A UI5 app creates a header and then its items in separate calls; failures leave orphan headers. How do you fix it?
  • A new field was transported to a SEGW service but does not appear in the Fiori app in QAS. What do you do?
  • How do you implement deep insert and changesets in a SEGW service?
  • Which Gateway tools do you use to troubleshoot OData V2 incidents, and for what?

Related topics

Interview questions on this topic