cancel
Showing results for 
Search instead for 
Did you mean: 

Lock in SAPUI5

Former Member
0 Kudos

Hi,

I have to create a UI5 application that needs to lock an order on the ABAP server while the user makes changes to the fields on the UI. How can I achieve this? I tried to read some forums and got some inputs on Softstate, Etags and Websockets but I am not sure how to use them.

Also, I tried to create a custom table entry in SAP with timestamp when a lock is set on the order, but what happens when the browser is abruptly closed? The lock would not be released on the server as the session is lost.

Any help is appreciated!!

Thanks,

Charles

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Charles,

You can use ENQUEUE_<lock object name>) and releasing (DEQUEUE_<lock object name> functions in anybackend request.


Before the enqueue you can schedule a job by code that dequeue the lock after

X time in case the browser is abruptly closed,


Function Modules for Lock Requests - Application Development on AS ABAP - SAP Library


Regards,

Arie.

Former Member
0 Kudos

This is not enough. You need to set your OData Service into Soft-State Mode. After that you can use the Enqueue-Dequeue functions. Otherwise the object is just locked for the time of execution with this request.

This is a good explanation of how to set your OData-Service to Soft-State Mode:

After the Service is set to soft-state you can implement the functions in one of the Operations of the Service. For example: Use Enqueue-Function in "GET_ENTITY" and Dequeue-Function in "UPDATE_ENTITY".

But: The Service just locks the order during the Service Session. This means: If the Timeout is set to 10 seconds (Service Settings in Transaction SICF) the order will be locked for 10 seconds if there is no other Request from your application within these 10 seconds.

If there is any other way to implement the locking im looking forward for your ideas!

Regards,

Sascha