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: 

HR_EMPLOYEE_DEQUEUE not workign in background

Former Member
0 Kudos

Hi All,

I am trying to insert new IT0002 record for employees using HR_INFOTYPE_OPERATION. I am enqueuing the employee before the HR_INFOTYPE_OPERATION and use HR_EMPLOYEE_ENQUEUE after that to release the employee. Now the problem is, it works perfect in foreground in all the modes(N,A,E). But when I sechedule the job in background, the employees are not dequeued. If there are more than one record for the employee, then I get the error "Personnel Number locked by..."

It works fine in background too if make the process to wait by adding WAIT UP TO 1 Seconds but I don't want to do that. Please let me know if there is another option or what is wrong in this process.

Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Please check if the below code helps in resolving the lock issue.


CALL FUNCTION 'HR_PSBUFFER_INITIALIZE'.

PERFORM enqueue_pernr(sapfp50g) USING gv_pernr 'S'.
SET UPDATE TASK LOCAL.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
...
PERFORM dequeue_pernr(sapfp50g) USING gv_pernr.

2 REPLIES 2

Former Member
0 Kudos

Please check if the below code helps in resolving the lock issue.


CALL FUNCTION 'HR_PSBUFFER_INITIALIZE'.

PERFORM enqueue_pernr(sapfp50g) USING gv_pernr 'S'.
SET UPDATE TASK LOCAL.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
...
PERFORM dequeue_pernr(sapfp50g) USING gv_pernr.

Former Member
0 Kudos

Thanks Suman it workd.

Setting the update task as local did it. I just added that part with my old code and it runs like a charm now.

Thanks again,

Daniel.