Skip to Content
author's profile photo Former Member
Former Member

BAPI_EMPLOYEE_ENQUEUE not working

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Jul 15, 2011 at 04:24 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 15, 2011 at 06:13 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.