cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Parallel Deletion In RAP managed Application

ULGIA
Explorer
445

Hello SAP Community,

I have a RAP managed application with the following setup:

  • strict ( 2 )
  • with draft
  • List Report without Object Page
  • OData V4 / SAP Fiori Elements
  • delete ( precheck ) implemented

Scenario:

When two tabs are open simultaneously with the same list report:

  1. User deletes a record from Tab 1 → success message shown → record deleted
  2. Record still appears on Tab 2 (page not refreshed)
  3. User selects the same record on Tab 2 and presses Delete
  4. Instead of showing a custom error message, the UI shows a success message again

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 ULGIA_0-1777365515313.png

     

  • REPORTED table is correctly populated with custom message ULGIA_1-1777365515373.png

     

  • MSGID and MSGNO are correct ULGIA_2-1777365515434.png

     

What I see in the network (F12):

The DELETE request returns HTTP 404 with:

 
 
json
{
  "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:

  1. Is this a known limitation of RAP with draft for the parallel delete scenario?
  2. Is there a way to intercept the 404 and surface the custom backend message?
  3. Would removing 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

Accepted Solutions (0)

Answers (2)

Answers (2)

Sandra_Rossi
Active Contributor
0 Likes

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)

RACHID_AITBOUALE
Contributor
0 Likes

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.

ULGIA
Explorer
0 Likes
Hello @RACHID_AITBOUALE, The problem in this case is that in the Create action, I need to have a warning pop-up screen, and that is simply not possible without draft capabilities. I had an idea to remove the draft, but it is necessary in my case.