cancel
Showing results for 
Search instead for 
Did you mean: 

Using RAP action for synchronous commiting processing (Another BO and outside of LUW)

07-07-2025 6:07 PM
DEV19 Explorer
3161 views 4 comments
SAP Managed Tags
Subscribe

Hello Community,

We're currently building a solution based on RAP unmanaged (OData V4 & on-premise 2023 FPS3) + OData V4 + Fiori Elements List Reports with multiple view entityset (for SAP BUILD Workzone) — around 10 tiles depending on user profiles.
With the goal of being cloud compliant (that's why we exluded SEGW).

Our backend scenario doesn’t follow a typical RAP-unmanaged BO:
We don’t have a persistent Z-table representing the main BO. Instead, we expose a merged view of:

  • Sales Orders,
  • Purchase Orders,
  • A custom Z-table that manages additional status, dates on them. And is updated both by UI and interfaces (IDocs, API, etc.).

Each List Report is tied to a projection CDS/behavior with specific actions available (from main behavior): Approve, Reject, Confirm, etc.
Some complex Actions must be executed synchronously to orchestrate multiple steps, (committing or rollback ourselves depending rules between step) and return structured information (e.g., results & messages) to the UI. The frontend expects instant feedback and reacts to message type (S, W, E...) to guide the user. Example sequences :

  • Update standard document via BAPI PO/SO
    (No use of standard RAP due to doc type not herited from NBF and some fields not managed by current RAP),
  • Update Ztable via EML (RAP),
  • Trigger external APIs.

 

🚫  Problem with RAP standard actions

We initially built RAP actions (with deep parameter) that return a complex response (deep result), for manage specifically result & messages in Fiori side. However, we quickly hit one RAP limitation :

  • You cannot commit or rollback inside an action.
    As it breaks RAP’s design principles (LUW control, Clean Core).

So we tried using cl_abap_parallel (released class) or even function modules with DESTINATION 'NONE', which technically allowed us to run parts of the logic in a separate LUW and return structured results synchronously.

And see some others Posts using these kind of workaround solution.

👌  This completely solved our issues at runtime — enabling orchestration, feedback, and proper error control.

However, after discussing with SAP, we were clearly told this is not a long-term solution.
Such techniques are discouraged as they break the RAP LUW model and violate Clean Core principles.

 

💡  SAP suggested:

Firstly :

"Trigger this logic in SAVE sequence via BGPF"

We did a full POC of this model and found several issues for our case:

  • No possibility to simulate during MODIFY runtime (action) before SAVE (to manage deep result at this time)
    You can't do a commit entity in simulation mode to know validation problems etc on our ztable rap. And some BAPI like SO can't be executed in simulation mode (due to authority-check triggered that can't be deactivate like PO BAPI)
  • COMMIT ENTITY (of another BO!) inside BGPF crashes
  • The user doesn’t get immediate feedback in UI
  • Save have only Reported return. Instead of action that can manage a deep result
  • We’d have to rework the entire UX logic (tracking status of BGPF per order to lock user action, error reprocess design, etc.)
  • Event RAP Side effects are not available in our current release (2023 FPS03. Available in 2025).
    From an API-only scenario, Side effects is not an option

Secondly :

Falling back to OData V2 SEGW (only for the action) and use Function Import POST — which gives us exactly what we need: a self-contained synchronous LUW with a structured response!

But as you know, SEGW is not released, so we aren't totally cloud compliante.

Today, this is the solution implemented. It kind of takes the soul out of our RAP implementation, which is frustrating 😅

 

👨‍🔬 Question to the community

  • How have you solved similar challenges?

  • @Andre_Fischer if you have time, we would really appreciate your insights on this case.

We’ve created a SAP Influence post to support this request → https://influence.sap.com/sap/ino/#/idea/351633/?section=sectionDetails

Have a nice day.

Clément

Accepted Solutions (0)

Answers (2)

Answers (2)

wkpk
Participant

 

We've reached the same, consistent conclusion: RAP can only address this issue through RAISE EVENTs, parallel processing, or background tasks. In other words, synchronous processing is not supported in the current version, which is the most inconsistent aspect of RAP.

@Andre_Fischer 

 

What do you think, Andre Fischer?

rammel_sapdev
Participant
0 Likes
I think the closest to synchronous that we can get for now is by using "event driven side effects". It is still asynch by nature but it will give you some notifications after the data have been updated.
MioYasutake
SAP Champion
SAP Champion

@DEV19 

How about creating a custom (frontend) action that calls an independent REST endpoint on your ABAP server that executes all the required tasks?

https://community.sap.com/t5/enterprise-resource-planning-blog-posts-by-sap/building-a-custom-http-s...

 

DEV19
Explorer

Hello @MioYasutake,

Yes, I believe this effectively addresses the need.

Ideally, I would have preferred to keep everything within the RAP framework to ensure a single point of entry — with the added benefit of enabling full-backend usage via EML.
However, your approach offers a very flexible and pragmatic alternative, especially given our current use case.