cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

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?

View Entire Topic
dhegde
Participant
0 Likes

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

Marian_Zeis
Active Contributor
0 Likes

Hi dhananjayhegde ,

thank you for your answer.

Unfortunately this does not work because I get this error when I want to implement the handler.
Also I haven't found anything else about it, so I guess that this is rather a workaround that is not so ideal.

dhegde
Participant
0 Likes

You could have separate class where you define the event handler method and then set this event handler in save_modified. That should work.

dhegde
Participant

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.