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.
What about CALL FUNCTION IN UPDATE TASK ? The module is started in this case after commit work only. But it runs completely asynchronously you have to pass all values as parameters.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Perhaps a "CALL FUNCTION DESTINATION 'NONE' IN UPDATE TASK" to be very sure 😄
This is probably the best idea. Better ideas might come with more info about what you want to do.
Hi lutzi3 and sschlegel ,
thank you for your answers.
We have also used exactly that:
CALL FUNCTION ''
STARTING NEW TASK 'UPDATE
DESTINATION 'NONE'.
Of course 'COMMIT' is used in the FM.
But I suspect with this, it is not waiting for the commit, because if i do a select in the commit, the DB is not yet updated.
With 'IN UPDATE TASK' it would probably wait for the commit, but that doesn't work together with 'DESTINATION NONE'.

Without 'DESTINATION' it dumps.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.