cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_EMPLOYEE_ENQUEUE not working

Former Member
0 Kudos

Hi All,

The FM gives us the error saying the "Personal number couldn't be locked" ,even thought we are using below FM's

Lock the Pernr

call function 'BAPI_EMPLOYEE_ENQUEUE'

exporting

number = lw_pa0006_92-pernr

importing

return = wa_return.

ls_p0006-pernr = lw_pa0006_92-pernr.

ls_p0006-begda = lw_pa0006_92-begda.

ls_p0006-endda = lw_pa0006_92-endda.

ls_p0006-stras = lw_pa0006_92-stras.

ls_p0006-pstlz = lw_pa0006_92-pstlz.

ls_p0006-ort01 = lw_pa0006_92-ort01.

ls_p0006-land1 = lw_pa0006_92-land1.

call function 'HR_INFOTYPE_OPERATION'

exporting

infty = '0006'

number = ls_p0006-pernr

subtype = '5'

validityend = ls_p0006-endda

validitybegin = ls_p0006-begda

record = ls_p0006

LOCKINDICATOR = 'X'

operation = 'INS'

importing

return = wa_return.

call function 'BAPI_EMPLOYEE_DEQUEUE'

exporting

number = ls_p0006-pernr

importing

return = wa_return.So is there any issue with this code?

We have cross checked but the pernr is not locked by any othere person and there is no entry in SM12

Do any one have idea what could be wrong or is there any other FM to Lock the Pernr.

Regards

CB

Accepted Solutions (0)

Answers (2)

Answers (2)

jayantvenkata
Product and Topic Expert
Product and Topic Expert
0 Kudos

When you are using BAPI_EMPLOYEE_DEQUEUE to lock, and then try to unlock it will take longer time to appear as unlock untill the Commit work is done.

This is the standard design behaviour.

Thanks and Kind Regards

Ramana

Former Member
0 Kudos

Hi Jaynthi,

Thanks a lot ,so what should we need to do to avoid this ? Any solutions ,the thing is that we are updating more than 5 infotypes back to back.

Regards

CB

Former Member
0 Kudos

Hi,

Or Maybe the employee is locked in PA30/40 screens by another user.

Regards,

Dilek

Former Member
0 Kudos

Hi,

No it is not possible since we are updating in the process of new user creation ,so till this process completes no one can use it.

Regards

CB

Former Member
0 Kudos

Hi

Any one have idea about the issue?

Regards

CB

jayantvenkata
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello

If you want to call these BAPI methods, you first have to call the BAPI BAPI_EMPLOYEE_ENQUEUE to lock the employee and afterwards to unlock the employee the BAPI BAPI_EMPLOYEE_DEQUEUE.

The infotype BAPIs don't lock the employee, and you have to do it manually.

Thanks and Kind Regards

Ramana

Former Member
0 Kudos

Hi,

Sorry did't get your answer ,there we are using the BAPI_EMPLOYEE_ENQUEUE to lock at the frist setp only right,but the BAPI is not locking the pernr ,that is the issue here.

Regards

CB