‎2007 May 09 4:51 PM
I am processing 2000+ records in a loop and the function BAPI_EMPLOYEE_DEQUEUE is not releasing any of the employees until the entire loop has finished. A very simplistic version of my code is:
LOOP AT rec.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
CALL FUNCTION 'HR_INFOTYPE_GETDETAIL'
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
ENDLOOP.
Does anyone know why it is not releasing the employee until the end of the loop or how I can get this to happen? I did check and I am passing these functions the correct employee #'s.
Points will be rewarded.
‎2007 May 09 4:55 PM
Hi,
Please try to add COMMIT WORK after FM 'HR_INFOTYPE_OPERATION' when the update is successfully. Then you can call FM BAPI_EMPLOYEE_DEQUEUE'.
Regards,
Ferry Lianto
‎2007 May 09 4:55 PM
Hi,
Please try to add COMMIT WORK after FM 'HR_INFOTYPE_OPERATION' when the update is successfully. Then you can call FM BAPI_EMPLOYEE_DEQUEUE'.
Regards,
Ferry Lianto
‎2007 May 09 5:02 PM
‎2007 May 09 5:06 PM
Hi,
Try ..COMMIT WORK AND WAIT...For V1 updates to get completed..
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
Thanks,
Naren
‎2007 May 09 5:52 PM
Darn thing. I tried both the COMMIT WORK AND WAIT.
and COMMIT WORK in vairous places and it still does not release the employee until after the entire loop is finished. Doesn't make any sense to me. Any other ideas?
‎2007 May 09 9:56 PM
I'm still not having any luck. If someone has some sample code could you perhaps send it to me? thx
‎2007 May 09 5:13 PM
Hi janice,
1. I had also done this kind of loop, but it was working fine.
2. Maybe ucan try commit work after
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
regards,
amit m.
‎2007 May 09 10:06 PM
Hi,
Instead of calling Enqueue..Dequeue..
Try calling the FM BAPI_EMPLCOMM_CHANGE directly..
Thanks,
Naren
‎2007 May 09 10:12 PM
This is obviously my day to be a blond. Somedays you just can't see the obvious. I just figured it out.
My 2 function calls were calling different employee #'s .... one was calling '1234' and the other was calling '00001234'. I can't believe I have been struggling with this!!
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
thx for your responses. I am still going to reward points because I appreciated the responses.
‎2011 Dec 20 9:04 AM
Hi Janice,
I just figured out that I did the same mistake as you did and have been struggling for hours. You made my day.
Cheers,
Amber