on 2026 Apr 28 9:39 AM
Hello SAP Community,
I have a RAP managed application with the following setup:
strict ( 2 )with draftdelete ( precheck ) implementedScenario:
When two tabs are open simultaneously with the same list report:
What I have implemented:
In precheck_delete I do a direct SELECT from the persistent table. If sy-subrc <> 0 (record not found), I populate failed and reported with a custom error message.
What I have confirmed in the debugger:
FAILED table is correctly populated
REPORTED table is correctly populated with custom message
MSGID and MSGNO are correct
What I see in the network (F12):
The DELETE request returns HTTP 404 with:
{
"error": {
"code": "/IWBEP/CM_V4S_RUN/000",
"message": "Unspecified provider error occurred"
}
}It seems the OData framework returns 404 before the precheck result is evaluated, completely bypassing my custom message.
Important note:
A colleague has a similar application without with draft — in his case precheck works perfectly, the delete is blocked and the custom message is shown correctly with HTTP 202 response.
My questions:
with draft be the correct solution given that draft is not actively used in our app?Any help or suggestions would be greatly appreciated.
Editing is disabled for this application
Kind regards
Request clarification before answering.
If you want to publish an answer that was helped/created by GenAI, you must include this statement: "GenAI was used to help generate this content." (Help - SAP Community)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @ULGIA,
This is an interesting edge case that highlights how the Draft framework changes the standard OData V4 orchestration in RAP.
The core issue here is likely how the OData V4 inbound handler processes the request before it even reaches your business logic. When with draft is active, the framework expects a specific state-handling sequence. If the record is already gone from the persistent table, the framework triggers an automatic HTTP 404 (Not Found) because the resource identified by the URL/Key no longer exists.
In a non-draft scenario (like your colleague's), the flow is more direct, allowing the precheck_delete to serve as the primary gatekeeper and return a 202 with your custom message.
To answer your specific points:
Is this a known limitation? It is less of a limitation and more of a standard OData V4 behavior where resource existence is verified before logic execution. With Draft enabled, this check is often stricter.
Intercepting the 404: Since the framework throws the 404 at the gateway level, it is very difficult to surface a custom backend message once that status is set.
The 'Draft' Decision: If your application is a List Report without an Object Page and editing is disabled, you are essentially using Draft for a read-only/delete-only scenario. In this case, removing with draft is likely the most efficient solution. It simplifies the state handling and allows your precheck_delete logic to function as intended, providing a better UX with your custom error message.
Unless you plan to implement complex 'Draft' features later, keeping the architecture 'Clean' by removing the unnecessary draft overhead would be my recommendation for this optimization.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.