4/7/26, 9:12 AM SAP RAP ABAP Cheatsheet v2
✦ SAP RAP ABAP — Issues, Fixes & Concepts (100% Verified) ✦ ✓ SAP Docs Verified
Managed Scenario Unmanaged Scenario Draft Handling
1 Error not showing on Fiori UI 1 Data not saving to DB 1 Draft not activating — Draft table missing
Cause: REPORTED not filled or missing %tky Cause: save_modified method in saver class Cause: Draft not enabled in BDEF or draft table
Fix: Fill BOTH failed-entity AND left empty not created
reported-entity with %tky . FAILED Fix: Write INSERT / UPDATE / DELETE DB Fix: Add with draft; draft table
blocks save. REPORTED shows the message on statements inside save_modified method of ZDRAFT_TAB in BDEF. Create and activate the
screen. Without %tky in REPORTED — lsc_* saver class. This is the ONLY place DB draft DB table. Must have same structure as
message is lost. writes happen in unmanaged RAP. persistent table + DRAFTUUID key field.
2 Determination result not visible before Save 2 Determination not working — no Draft 2 Validation not running in Draft mode
Cause: Used on save instead of on modify Cause: SAP rule — determinations are NOT Cause: Validation defined but not assigned to
Fix: on modify — triggers during interaction supported for unmanaged RAP BOs without PREPARE action
phase, result shows before save. on save — draft Fix: Add validation inside draft determine
triggers only during save sequence, result shows Fix: Either enable Draft in BDEF ( with action Prepare { validation myValidation;
after save. Choose based on when you want the draft; ) or move the derivation logic directly } in BDEF. Without PREPARE, validation only
UI to update. inside the handler method (create/update). runs at Activate — user sees no feedback during
editing.
3 Validation not blocking save ⚠ SAP Official Doc: "Not available for
Cause: Only REPORTED filled — FAILED table unmanaged, non-draft RAP BOs" 3 Number gap when save fails (Number Range)
is empty Cause: Number consumed in determination — but
Fix: REPORTED alone shows a message but
3 BAPI call failing / LUW error save fails — number is gone
Cause: BAPI called in interaction phase (handler
does NOT block save. You must fill failed- Fix: Use Late Numbering (assign number in
method) — violates RAP LUW contract
entity with %tky to block the transaction. adjust_numbers saver method just before DB
Fix: Buffer the data in interaction phase. Call
Both are always needed together. write). OR buffer the number in a singleton class
BAPI only inside save_modified method —
and free it in cleanup on rollback.
4 Field is read-only on Fiori — can't edit after the interaction phase, during save
Cause: Field declared field ( readonly ) in sequence. 4 OData error: IsActiveEntity key issue
BDEF Cause: Draft-enabled BO uses OData V2 service
Fix: Remove field ( readonly ) , or use
4 COMMIT WORK causing dump binding — draft requires V4
Cause: COMMIT WORK inside RAP behavior
feature control: field ( features : Fix: For all draft-enabled RAP BOs, always create
breaks the RAP LUW contract
instance ) for conditional editability per service binding with OData V4 - UI . OData V2
Fix: Never use COMMIT WORK inside RAP. In
record. does not support draft protocol
Fiori, RAP runtime commits automatically. For
( IsActiveEntity ).
external EML consumers, use COMMIT
ENTITIES only.
[Link] 1/3
4/7/26, 9:12 AM SAP RAP ABAP Cheatsheet v2
⚠ COMMIT WORK = runtime dump inside RAP
behavior pool
CDS Views & Service Layer EML — Entity Manipulation Language Numbering & Keys
1 No columns in Fiori List Report 1 Field not updating via MODIFY ENTITIES 1 Early Numbering — when to use
Cause: Missing @[Link] annotation in Cause: Using FROM variant without setting Use when: Key is a UUID (system generated).
Projection CDS view %control Framework assigns key immediately at CREATE
Fix: In the ZC_* projection view (or metadata Fix: With FIELDS ( field1 ) WITH — time during interaction phase. BDEF syntax:
extension), add: @[Link]: [{ framework sets %control automatically. With early numbering . Key field type:
position: 10 }] on each field you want as a FROM variant — you MUST set %control- [Link](16) . UUID generated by
column. fieldname = if_abap_behv=>mk-on for each cl_system_uuid=>create_uuid_x16_static() .
field. Only marked fields are written.
2 Fiori preview — "App could not be opened" 2 Late Numbering — when to use
Cause: Service binding not published, or wrong 2 EML READ returns empty result Use when: Key comes from a Number Range
binding type Cause: Keys not correctly populated or reading (semantic key). Key assigned just before DB write
Fix: In ADT — right-click service binding → outside behavior pool without released API in adjust_numbers saver method. BDEF syntax:
Publish. Use OData V4 UI binding for Fiori Fix: Inside behavior pool use READ ENTITIES late numbering . Use %pid (preliminary ID)
Elements. Use OData V2 UI only for older ... IN LOCAL MODE . Pass correct keys via during interaction phase to identify records before
apps. Missing publish = 404 error in preview. CORRESPONDING #( keys ) . Outside behavior key is known.
pool, use READ ENTITIES OF ... ENTITY ...
3 Action button not visible on UI ALL FIELDS WITH VALUE #( ( %key = ... )
3 adjust_numbers not called — key stays empty
Cause: Action defined in BDEF but UI Cause: Late numbering defined in BDEF but
) .
annotation missing, or action not exposed in adjust_numbers not implemented in saver class
projection BDEF 3 %cid not mapped — key unknown on CREATE Fix: In lsc_* saver class, redefine
Fix: In metadata extension add: Cause: Internal numbering — final key not yet adjust_numbers . Read %pid from mapped
@[Link]: [{ type: #FOR_ACTION, assigned during interaction phase table. Assign final key. Map %pid → %key in the
dataAction: 'actionName', label: 'Button Fix: Use %cid as temporary unique ID in mapped return parameter.
Label' }] . Also check projection BDEF CREATE. To reference the instance before key
exposes the action with use action is known, use %cid_ref in follow-up UPDATE. 4 Managed: UUID key not auto-generated
Cause: Numbering not specified as managed in
actionName; Final key is mapped in adjust_numbers saver
method. BDEF
4 Association not visible in Fiori Fix: Add field ( numbering : managed )
Cause: Association defined in interface CDS but 4 EML MODIFY inside Validation — dump EntityUUID; in BDEF. Define key field as
not exposed in projection CDS Cause: RAP contract — EML MODIFY is strictly [Link](16) UUID type in DB table.
Fix: In ZC_* projection view add: forbidden inside validations Framework generates UUID automatically on
association _AssocName; explicitly. Fix: Use MODIFY only in Determinations or CREATE.
Associations are NOT auto-inherited into Actions. Validations can only READ. Never write
projection — must be explicitly re-exposed. data inside a validation method.
[Link] 2/3
4/7/26, 9:12 AM SAP RAP ABAP Cheatsheet v2
⚠ SAP Doc: "It is not allowed to use EML
MODIFY statements in validations"
⚡ RAP Debugging Approach 💡 Interview Tips — Powerful Answers
When your RAP app breaks — follow this order:
Q. Managed vs Unmanaged — what is the difference?
1 Check BDEF first — is the operation / action / validation actually defined "In Managed RAP, the framework handles CRUD and save automatically. I write only
and exposed in projection BDEF? business logic — validations, determinations, actions. In Unmanaged, I write
everything including the save method. Managed is used for Greenfield (new tables).
2 Check FAILED + REPORTED — both filled? %tky present in both? FAILED
Unmanaged is for Brownfield (reuse of existing BAPIs or legacy code)."
blocks save. REPORTED shows the message.
3 Use ABAP Cross Trace in ADT — full end-to-end RAP trace (runtime,
gateway, SADL, BO runtime). Best tool for RAP. Q. Why FAILED and REPORTED both needed in validation?
"FAILED tells the RAP framework to reject the transaction — save is blocked.
4 Use /IWFND/TRACES or /IWFND/GW_CLIENT for OData request/response
REPORTED carries the message to display on the Fiori screen. If only REPORTED is
analysis in on-premise systems.
filled — user sees a message but save still happens. If only FAILED is filled — save
5 Set breakpoint inside behavior pool handler class ( lhc_* ) → use ABAP is blocked but user sees nothing. Both must always be filled with correct %tky."
Debugger in ADT.
6 Use ABAP Unit Tests with test doubles to test BO logic independently —
Q. Difference between on modify and on save determination?
without Fiori. Fastest way to isolate logic bugs.
"On modify triggers during the interaction phase — whenever data changes. Result is
visible on Fiori screen before save. Good for fast field derivations like calculating
totals. On save triggers during the save sequence. Result is visible only after save.
Good for performance-intensive operations like external API calls."
✦ Pankaj Kumar | SAPTECH MADE EASY | ABAP Ritual Community | All content verified from SAP Official Documentation ✦
[Link] 3/3