cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Drafts in RAP with Optimistic Merge

mvoros
Active Contributor
165

Hi experts,

Let's start with the context first. We have an existing app that was built with BOPF and oData v2 service on top of it. We built our own draft implementation as it was not available with BOPF. To simplify it, the main business object consists of a header and multiple items. You can think of it as a collaborative plan between multiple users. We allow users to work on this object in parallel as 95% of time, each user is updating own set of items. In our draft activation logic, we check if items, that has been modified by the user, have been modified by another user(s) in parallel. We simply compare "changed at" with the "changed at" value captured during draft creation. As I said, most of the time this works fine as users have their own sets of items and users can come up with a plan. Sometimes this does not work. In that case the first user wins and the loser needs to start again. This feature works really well for users and it's crucial for us.

Now we want to move this app to ABAP Cloud with RAP. Any idea how could this be achieved? I looked at the draft table generater by RAP. The problem is that the draft table has same primary key as the main table and it uses the same primary keys of the instances. Hence it's not possible to save multiple drafts into this table. Alternatively, I was thinking about items being own business objects and header being another object that simply links to these child objects. Unfortunately, I don't think this will work as the users expect that when they go to edit mode, they can update any item. We would have to create a draft for every child object and that would prevent users working on parallel as other users would not be able to create parallel draft.

Is there a way with unmanaged implementation to override draft logic that allows creation of parallel drafts (one draft per user) and own logic for draft activation? Is it possible to provide a custom implementation for methods related to draft handling? Could we simply extend draft table key with username to allow one draft per user? Or is there other way how to achieve this?

I've seen the previuew of "SAP Fiori Collaborative Draft" in ABAP RAP that is on the roadmap and should be available with 2508. This does not seem to fit our use case as in this case, the user needs to invite another person into editing. In our case, the users are working in parallel without necessary knowing about each other.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert

Hi MVoros,

I have good news for you since the roadmap information is (currently) not clear.

Indeed, the sentence can be misunderstood in a way that it is mandatory to invite other users which is not the case.

When using collaborative draft any user that that has the autorization to see and edit the instance of an entity or that has the authorization for global create is able to work on an entitiy that is in collaborative draft.

In addition a user can actively invite further persons to edit the same data in the Fiori application.

So the invite can be used to notify somebody so that this person should doublecheck the data that you have entered.

Kind regards,

Andre

 

mvoros
Active Contributor
0 Kudos
Thanks, as discussed via other channel, we will try to leverage this new feature offered by RAP framework.

Answers (0)