Application Development 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: 

ECC HR module: issue while locking employee record via RFC

MartinMaruskin
Active Contributor
0 Kudos

Hi all,

I need to perform a lock for an employee before I do an update of that record. While I use function modules like BAPI_EMPLOYEE_ENQUEU​E or HR_EMPLOYEE_ENQUEUE in my custom ABAP report it all works.

However if I call these function modules from my external JAVA app the lock is not set. While I debug this there is a call of another FM  ENQUEUE_EPPRELE which calls kernel function C_ENQUEUE. The kernel function properly sets the lock. I can see it in tcode SM12. However while I leave in debugger end of top level BAPI e.g. BAPI_EMPLOYEE_ENQUEU​E the lock is gone.

I even tried to create my custom BAPI which calls FM ENQUEUE_EPPRELE but behavior is the same. All of these BAPIs (standard and custom) one is working in my ABAP reports but they all do not work (they do not set the lock) while they are called remotely from ext JAVA app.

Is there anything special with regards to locking of employee number in SAP HR module?

Are there any other options on how to lock the employee except those BAPIs?

thanks!

m./

1 ACCEPTED SOLUTION

MartinMaruskin
Active Contributor
0 Kudos

This issue is not caused by SAP. To solve this I had to reconfigure a way how the lock BAPI and subsequent BAPI which does another operation (update) for the employee is called in my JAVA app.

It must be always ensured both BAPIs are called using the same transaction.

1 REPLY 1

MartinMaruskin
Active Contributor
0 Kudos

This issue is not caused by SAP. To solve this I had to reconfigure a way how the lock BAPI and subsequent BAPI which does another operation (update) for the employee is called in my JAVA app.

It must be always ensured both BAPIs are called using the same transaction.