ERPClimb logoERPClimb
RAP, EML, CDS and draft failures
SAP Debugging & Root Cause Analysisadvanced 6 min read

RAP, EML, CDS and draft failures — Concepts and mental models

Free sample lesson · open to everyone

Key takeaway

Training simulation: All sample identifiers, logs, requests, transactions, values and cases are fictional. Tools and permissions vary by SAP release; perform any changes only in approved DEV/QA environments. RAP, EML, CDS and draft failures — Concepts and mental models Outcome: Find the correct behavior phase, REPORTED/FAILED response and CDS association source of truth.

In this lessonShow sections

Visual overview

RAP, EML, CDS and draft failures: concept evidence mapOriginal editorial vector showing three context-specific checks for technical debugging.ERPCLIMB • SAP DEBUGGING • CONCEPTRAP, EML, CDS and draft failures1. Understand the business boundaryA RAP request crosses multiple layers: consumer and OData request, CDSprojection/exposure, behavior contract, implementation, transactionalbuffer, save sequence and persistence. Debug the failing…2. Identify the execution mechanismFAILED and REPORTED are structured business outcomes, not simplyuncaught ABAP dumps. EML READ or MODIFY can return messages even whenthe HTTP envelope is technically accepted. Distinguish feature…3. Choose evidence, not assumptionsCDS path expressions and association cardinality can change row counts;DCL can hide data for a user. Check the consumer's role and projectionbefore blaming the behavior handler for missing…Educational flow • SAP edition and permissions vary • test in DEV/QA

The situation: a real project scenario

Synthetic case: A RAP action succeeds locally but fails save, draft or authorization checks.

In the featured case, the browser sent an old ETag after another session updated the active record. The service correctly rejected the stale modification rather than silently overwriting newer data.

Explanation

Training simulation: All sample identifiers, logs, requests, transactions, values and cases are fictional. Tools and permissions vary by SAP release; perform any changes only in approved DEV/QA environments.

RAP, EML, CDS and draft failures — Concepts and mental models

Outcome: Find the correct behavior phase, REPORTED/FAILED response and CDS association source of truth.

Environment: RAP managed/unmanaged behavior, EML and CDS on supported ABAP Platform/ABAP Cloud; draft and authorization behavior vary by service.

Mental models

1. Understand the boundary

A RAP request crosses multiple layers: consumer and OData request, CDS projection/exposure, behavior contract, implementation, transactional buffer, save sequence and persistence. Debug the failing phase, not an arbitrary database write. Managed and unmanaged scenarios place different responsibility on framework versus application code.

2. How this investigation works

FAILED and REPORTED are structured business outcomes, not simply uncaught ABAP dumps. EML READ or MODIFY can return messages even when the HTTP envelope is technically accepted. Distinguish feature control, instance authorization, validation, determination, lock, ETag and draft ownership.

3. Evidence-based decisions

CDS path expressions and association cardinality can change row counts; DCL can hide data for a user. Check the consumer's role and projection before blaming the behavior handler for missing entities. Draft data and active data must be inspected separately when a stale draft is involved.

Three common false diagnoses

  • An HTTP 412 is often a failed concurrency precondition rather than proof of a backend dump.
  • FAILED/REPORTED messages can represent expected business validation; inspect their keys and state.
  • A missing CDS row under a restricted user can result from DCL, not a failed SQL join.

Synthetic evidence

text
PATCH /Orders(OrderUUID=guid'DEMO')If-Match: W/"etag-old" → HTTP 412 Precondition FailedEML TEST (separate scenario): FAILED-order key DEMO-42REPORTED-order severity error: 'Order cannot save without company code'Draft owner TEST_A; active ETag has changed

Diagnostic flow

  1. Reproduce action, draft context and EML response
  2. Inspect behavior handler, saver, DCL and associations
  3. Validate ETag, authorization and persisted state

Tools

ADT · EML · RAP behavior debugger · SQL trace · DCL

Check your understanding

Question: A Fiori RAP draft save returns HTTP 412 and an old If-Match. Where should you investigate first?

A. Optimistic concurrency token and active entity version.
B. Unconditionally bypass ETag validation.

C. Delete active data from database.

Correct: A. Precondition failure indicates stale concurrency metadata; refresh and reconcile before retry.

Safety: Never disable locking, DCL or instance authorization to make a RAP example pass. Use nonproduction service keys and test fixtures.

Code example

ABAP Code
PATCH /Orders(OrderUUID=guid'DEMO')If-Match: W/"etag-old" -> HTTP 412 Precondition Failed      // concurrency token is stale, not a backend dumpEML TEST (separate scenario): FAILED-order key DEMO-42REPORTED-order severity error: 'Order cannot save without company code'  // a structured business message, not an exceptionDraft owner TEST_A; active ETag has changed // Debugging technique: HTTP 412 is a concurrency/ETag problem, not proof of a server error - refresh the entity// to get the current ETag before retrying. Separately, treat FAILED/REPORTED as structured business outcomes:// inspect their keys and message severity rather than searching for an uncaught ABAP exception.

Watch out

Common mistakes

  • An HTTP 412 is often a failed concurrency precondition rather than proof of a backend dump.
  • FAILED/REPORTED messages can represent expected business validation; inspect their keys and state.
  • A missing CDS row under a restricted user can result from DCL, not a failed SQL join.

Do this

Best practices

Refresh the active entity and ETag, present the conflict to the user, then resubmit only after reconciliation. Preserve valid lock, authorization and validation logic and use separate fixtures for each failure class.

  • Positive: Current ETag allows a valid authorized update with correct persisted active data.
  • Negative: Stale If-Match returns a controlled concurrency failure without overwriting another user's change.
  • Cross-process: Missing mandatory data and unauthorized users still fail with accurate business/authorization messages.

Never disable locking, DCL or instance authorization to make a RAP example pass. Use nonproduction service keys and test fixtures.

In the interview

Interview angle

Question: A Fiori RAP draft save returns HTTP 412 with an old If-Match header. Where should you investigate first?

Strong answer: The optimistic concurrency token and the active entity's current version - a 412 indicates stale concurrency metadata (the draft was based on an outdated ETag), not a backend defect. Refreshes the entity to get the current ETag and reconciles before retrying, and checks draft vs active data separately if a stale draft is suspected.

Weak answer: Proposes bypassing ETag validation entirely, or deleting the active data from the database to "reset" the conflict.

Also expect: debugging behavior implementations, understanding FAILED/REPORTED structures as business outcomes rather than dumps, ETag and draft lifecycle issues, checking CDS access controls (DCL) when expected data is missing, and inspecting generated SQL for association/cardinality surprises.

Practice this lesson

Original educational case studies for SAP consultants, not official SAP certification exam questions. Verify product edition and implementation details against the current SAP documentation.

Quick check

0 of 4 questions attempted

Question 1 of 4

A Fiori RAP draft save returns HTTP 412 and an old If-Match. Where should you investigate first?

Practise this in an interview

Answer in your own words and get instant feedback, the way an interviewer would judge it.

1How do you debug missing data in a CDS-based Fiori app?

2Explain how you'd analyse a RAP save that fails with a generic error.

Was this lesson helpful?

Keep exploring

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.