Skip to Content
avatar image
Former Member

Error msg Employee/applicant is not locked yet while BAPI_PERSDATA_CHANGE

Hi all,

I'm testing the BAPI BAPI_PERSDATA_CHANGE in se37. Before that m locking the employee using bapi_employee_enqueue. But while executing the BAPI_PERSDATA_CHANGE m getting the error Employee/applicant is not locked yet. I have used BAPI_TRANSACTION_COMMIT after locking the employee.

I wrote a sample code for changing the personal data. and through the code m able to change the personal data of an employee. But while testing through se37 m getting the error Employee/applicant is not locked yet. Is it not possible to change the personal data just executing the all required bapi's in sequential order: bapi_employee_enqueue ,BAPI_PERSDATA_CHANGE ,BAPI_TRANSACTION_COMMIT

Can anyone help on this. I have exposed these BAPI's for changing the personal data of an employee.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Dec 20, 2011 at 12:16 PM

    Hi ramya,

    Before changing employee personal info, you need to lock the employee id by using function module ENQUEUE_EPPRELE.

    SEQUENTIALLY YOU NEED TO DO THIS.

    call function 'ENQUEUE_EPPRELE'.

    call function 'BAPI_PERSDATA_CHANGE'

    call function 'DEQUEUE_EPPRELE'.

    this will resolves your problem i hope.

    Regards

    Ravi

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 20, 2011 at 12:48 PM

    Hi,

    go to se37 and under menu bar select functional module option click on test and click on test sequence and test your frictional module

    Thanks'

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Vibin,

      I have tested the fn modules through test sequence in se37 and it worked. Now i have created a webservice and trying to chnage the data of an employee and following was the sequence which was called:

      BAPI_EMPLOYEE_ENQUEUE

      BAPI_TRANSACTION_COMMIT

      BAPI_PERSDATA_CHANGE

      BAPI_TRANSACTION_COMMIT

      BAPI_EMPLOYEE_DEQUEUE

      BAPI_TRANSACTION_COMMIT

      while executing each BAPI return table is empty that means the BAPI's are working fine without any error.But when m trying to see the details of the employee which was used to change the personal data through PA30 its giving me an error Person locked by the User But the BAPI_EMPLOYEE_DEQUEUE is working fine.

      Onemore thing webservice which i have created was saved in local object and m able to chnage the personal data of an employee but unable to unlock the employee.

      But for the webservice which was saved in a package m unable to change the personal data using BAPI_PERSDATA_CHANGE because its giving me the error Employee not locked yet

      Could anyone suggest me with this strange behaviour.

  • Dec 28, 2011 at 02:01 PM

    Hi,

    Please try doing all the operations in one LUW.

    When we tried to pass the data from Jco ( Java Connector) and change the same in SAP, we faced similar problem.

    The changes are not replicated in SAP and even we didn't get any errors from BAPI's.

    Then we tried executing all steps ( changing the data and committing the data ) in one LUW. This worked.

    Please reward points if this info is useful.

    Thanks,

    naveen

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi.

      I found the correct form to use.

      BAPI_EMPLOYEE_ENQUEUE

      BAPI_PERSDATA_CHANGE

      BAPI_EMPLOYEE_DEQUEUE

      In a java file need use JCoContext to generate a group functions to will be execute

      try {

      JCoContext.begin(destination);

           if (JCoContext.isStateful(destination))

                bloqFunction.execute(destination);

                cambFunction.execute(destination);

                desbFunction.execute(destination);

      } finally {

      JCoContext.end(destination);

      }

      Declarated:

      JCoFunction bloqFunction = destination.getRepository().getFunction(

                          "BAPI_EMPLOYEE_ENQUEUE");

      JCoFunction cambFunction = destination.getRepository().getFunction(

                                              "BAPI_PERSDATA_CHANGE");

      JCoFunction desbFunction = destination.getRepository().getFunction(

                                              "BAPI_EMPLOYEE_DEQUEUE");

      I hope help with this.