Hello experts,
we have a Fiori Elements App with managed RAP and OData V4 and Draft (2021SPS01).
We would like to execute a function module (with 'COMMIT WORKS' in it) after every save in the Fiori App (Create/Update).
As far as I know, the following options are still before the commit or the data is persisted in the table.
So the function module can't access it yet.
We tried this so far:
"with additional save"
"determination method on save { create; update;}"
In both implementations, when we try so SELECT from the database, the newly created data is not yet commited.
Are there other alternatives in the RAP Framework?
In the Fiori Framework there is the event "attachAfterActivate", but apparently only in the V2 Framework?
What I have not tried yet, but what is also not ideal,attach to an event directly on the V4 model like createCompleted.
What options do we have here?
Request clarification before answering.
Hi Marian
One other option you could try is to set a event handler for event TRANSACTION_FINISHED of class CL_SYSTEM_TRANSACTION_STATE in SAVE_MODIFIED method.
This event is raised at the end of RAP save sequence when "COMMIT WORK" is executed. So, you can be sure that the changes are saved to DB by this time.
Hope this helps.
Thank you,
Dhananjay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Regarding whether this is ideal solution or not:
I not sure as well. On one hand, this is not part of public API. So, may not be ideal to use it.
On the other hand, when I check the where used list of this event, I see many applications including RAP BOs using it. May be a work around, used by many 🙂
Would be nice if RAP framework provides a exit in save sequence to plug into after COMMIT WORK is done. I think we cannot redefine the CLEANUP method as well in "managed" implementations.
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 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.