cancel
Showing results for 
Search instead for 
Did you mean: 

Error msg Employee/applicant is not locked yet while BAPI_PERSDATA_CHANGE

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

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

Former Member
0 Kudos

Hi ,

Can you please elaborate on this. Right now we are executing the BAPI's in sequential order. Do you mean that it requires any coding in JAVA to call them in one LUW?

I'm calling the functions (through the webservice) in the following sequence and also using commit BAPI in between those:

BAPI_EMPLOYEE_ENQUEUE

BAPI_PERSDATA_CHANGE

BAPI_EMPLOYEE_DEQUEUE

Sometimes The ENQUEUE and CHANGE operations are working fine, but the record remains locked after that.

(as seen by SM12), it adds one more entry, and the employee remains locked. So question now is - how to successfully Dequeue it now ?

Important: The entries disappear after a while, so there is a delay in DEQUEUE to take effect.

Is there any configuration/customization to make DEQUEUE happen immediately?

Can anyone help me on this m facing this problem since long time.I have the searched the forums but didn't get any solution.

Thanks

manuel_garcia3
Explorer
0 Kudos

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.

Former Member
0 Kudos

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'

Former Member
0 Kudos

I'm testing in the same the waythrough SE37. First i have executed ENQUEUE_EPPRELE then BAPI_PERSDATA_change still m getting the error Employee/applicant is not locked yet. As i told m able to do change the data through code but i dont to do through coding. I have exposed these BAPI's as webservice and other application is trying to consume the same.

Can anyone help me is it possible to consume BAPI_PERSDATA_change when exposed as webservice.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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