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: 

Error msg Employee/applicant is not locked yet for 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.

7 REPLIES 7

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

0 Kudos

Hi Parupelly,

I have tried testing the way u said through 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.

0 Kudos

Hi,

Could you provide what are parameters you are passing for these function modules.

CALL FUNCTION 'ENQUEUE_EPPRELE'

EXPORTING

MODE_PREL = 'E'

MANDT = SY-MANDT

PERNR = "emp id

INFTY = "info type

SUBTY = "subtype

ENDDA = "end date

BEGDA = " start date

CALL FUNCTION 'BAPI_PERSDATA_CHANGE'

EXPORTING

EMPLOYEENUMBER = "emp id

SUBTYPE = "sub type

OBJECTID = ' ' "pass space

LOCKINDICATOR = ' ' "pass space

VALIDITYBEGIN = "start date

VALIDITYEND = "enddate

RECORDNUMBER = 000

  • FORMOFADDRESS =

  • FIRSTNAME =

  • LASTNAME =

  • NAMEATBIRTH =

  • SECONDNAME =

  • MIDDLENAME =

  • FULLNAME =

  • KNOWNAS =

  • ACADEMICGRADE =

CALL FUNCTION 'DEQUEUE_EPPRELE'

EXPORTING

MODE_PREL = 'E'

MANDT = SY-MANDT

PERNR = "emp id

INFTY = "info type

SUBTY = "subtype

ENDDA = "end date

BEGDA = " start date

when you are trying to change the employee personnel data, no other person should make pa30 in change mode of respective employee id.

can you tell how you are processing these function modules, so that i can help you.

Regards,

Ravi

0 Kudos

Hi Paupelly,

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

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. BAPI_EMPLOYEE_DEQUEUE is while executing but its not unlocking the employee.

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.

0 Kudos

Hi Ramya,

Did you got solution of your problem.If yes provide me solution.

Thanks,

Ravi

0 Kudos

I didn't get the solution yet

Former Member
0 Kudos

I've got the same error.

If I go into debug mode it works fine. It looks like the program is faster then the ENQUEUE_EPPRELE FM.

I have tried to get a BAPI_COMMIT between the FM's but that doesn't work either.

This can be fixed with a WAIT UP TO X SECONDS. But thats not an option we want.

Is there a way to check if the PERNR is blocked in the same program? I've searched the SCN for this without any results.