Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Lock object with database persistence

Former Member
0 Likes
735

Hello,

I need to lock an employee, but I don't want to lose the lock when the session is finished.

Do anyone know how to do this? Is there any kind of database persistence regarding lock objects?

The actual scenario is a process that's locking the employee with the FM BAPI_EMPLOYEE_ENQUEUE, and another process unlocking the employees with the FM BAPI_EMPLOYEE_ENQUEUE, however I need to guarantee the lock regardless whether the user will remain logged between one process and the other.

Kind regards,

Thiago

2 REPLIES 2
Read only

Former Member
0 Likes
569

Hi,

If you use the function module BAPI_EMPLOYEE_ENQUEUE then the Employee may enter in to SAP until you release the lock. you can use BAPI_USER_LOCK and BAPI_USER_UNLOCK

Regards

Sudheer

Read only

Former Member
0 Likes
569

Hi Sudheer,

Those FMs, either BAPI_USER_LOCK or UNLOCK don't solve my problem, because I don't want to lock users to log into SAP system.

I want to lock master data maintenance in HR (transaction PA30), this is the reason why I was using the FM BAPI_EMPLOYEE_ENQUEUE.

So, my problem is that I don't want to lose the lock even if I log off the system (the standard procedure is clean the lock table - SM12 - when all the transactions are closed).

Thanks,

Thiago