cancel
Showing results for 
Search instead for 
Did you mean: 

Update task in RAP model API

phoenixming0912
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi experts,

I have read through some RAP documents like this, regarding RAP API LUW.

As far as I understand, using UPDATE TASK is not required in the RAP model, but what if an implicit DB commit occurs after DB modification?

Here is an example, product API calls material master save BAdI, inside which, assuming there is a DB modification (SQL), afterwards there follows by an async RFC call which triggers an implicit DB commit. Is the data consistency corrupted? Is UPDATE TASK should be used for DB modification in the BAdI?

Regards,
Eric

 

phoenixming0912
Product and Topic Expert
Product and Topic Expert
0 Kudos
I updated the question, making it more specific.
View Entire Topic
thomas_mller13
Participant
0 Kudos

Implicit DB commits occur when you do RFC calls, 'submit report', 'selects', dynpro screen changes and in many other situations. What do you mean by async call? RFC? Then a implicit commit occurs. It is always a good idea to use update task. The BAPIs run also in update task. 

phoenixming0912
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Thomas, yes, this is the normal case. I am just curious about the following description "In the ABAP Cloud development model, the classic update task is not offered anymore." in the blog.
thomas_mller13
Participant

Yes. The reason is, that a LUW is no longer existing, since the UI5 restful communication with the server is stateless. After a UI roundtrip all context data on the server are gone. With the SAPGUI you could run a model class and a controller class in ABAP. The instances of these classes could exist until the user pushed the save button. Then the LUW could be closed by a COMMIT WORK.

Now each single webservice call is it's own LUW. It is really difficult to buffer intermediate states of a "business entity". They invented the draft concept for this problem, what stores intermediate states somewhere in the DB.

In other words: The MVC model is no longer possible. This is a huge disadvantage and from the view point of software engineering a huge negative progress. I really don't understand why not more developers recognize this problem. But in most cases they didn't use MVC.  But when you are using BAPIs you have anyway to use update task.