cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to set a permanent lock no matter the session is end or not?

Jerry_Lin
Advisor
Advisor
0 Kudos

Dear expert,

I am suffering from a challenge, I published my oData service to UI5 app providing a function like editing and saving an order, currently two users can edit the same order in the same time because I can't set the permanent lock for the firstly who click "Edit" button:

I did enque the object in oData implementation method, but when the service is end, the lock will be released implicitly, so the second user can Edit the same order eventually.

I know the etag is an good option to solve the situation, but what the customer want is the mechanism like Pessimistic Lock, once a user lock the oder, the others one can't change it in the same time, just like SAP GUI.

Any guys can help?

Accepted Solutions (1)

Accepted Solutions (1)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Jerry,

what you are looking for can be handeld via transactional applications that are leveraging the BOPF framework as described here:

https://help.sap.com/viewer/cc0c305d2fab47bd808adcad3ca7ee9d/201809.000/en-US/d36820f082c84085b6634b...

This however only works in a so called green field approach where you write data into new tables.

For a brown field approach where you create, update or delete data using classic API's such as BAPI's this does not work.

Here you have to wait until draft becomes available with the new ABAP RESTful Programming Model that is currently only available for the SAP Cloud ABAP Environment.

Best Regards,

Andre

maheshpalavalli
Active Contributor
0 Kudos

It works for normal scenarios as well I think it's just marketing gimmick from SAP?? or maybe it just doesn't support out of box and we have to do things manually. The Business partner(Customer & Supplier apps) are based on ABAP Programming model for fiori (with draft)

There are more than a couple of blogs which shows that and one such.

https://blogs.sap.com/2019/01/09/abap-programming-model-for-sap-fiori-draft-based-for-non-guid-keys-...

BR,

Mahesh

Jerry_Lin
Advisor
Advisor
0 Kudos

Thanks Andre, I searched a plenty of related problems that ABAPer facing, it's seems no standard solution to achieve the pessimistic lock mechanism on OP, I am now going to try the z-solution to cover the situation.

0 Kudos

Is there any solution in RAP managed without draft to have a lock set on click of edit button itself.

Regards,

Porselvan

Answers (1)

Answers (1)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert

Hi Mahesh,

it is not just a marketing gimmick from SAP.

It is as you said not supported out of the box by SAP. And with everything that is not officially supported you are doing this then you at your own risk.

(similar to using RFC function modules that are not released by SAP).

As I wrote the scenario of using classic API's for write access togethter with the ABAP Restful programming model is planned to become available and officially supported by SAP with an upcoming version of the ABAP Restful programming model.

Best Regards,

Andre

maheshpalavalli
Active Contributor
0 Kudos

Thanks Andre for the response!!

Now that makes sense. I am always surprised to hear whenever in restful programming model(RPM) blogs they always say that the BAPIs and exiting tables will only be supported from supported from RPM release and not in ABAP programming model(APM).

But why I said that "it might be a marketing gimmick" is that most of the standard apps that are created using the APM were internally calling some FM to do the CUD Operations and some of them don't even has the UUID as the key field. I feel like if some of the apps that are delivered by SAP are not following the so called standard approach then they should show that approach to the customers as well...

But hey customers will not jump to the cloud for the new RAP if they do that right 😛 :p... that's where i thought it is just a marketing gimmick 😄 😄 Hopefully they have a reason for not showing the approach they are following internally to the customers (maybe because it is a bug/error prone or maybe something else).

Best Regards,

Mahesh