05-25-2006 7:55 AM
Hey,
I am trying to execute a BAPI -> BAPI_ABSENCE_REQUEST, but for whatever employee number i use , i keep gettin the error "Employee / Applicant not locked yet" .. Why is this happening ? I previously created a leave request for the same employee through this BAPI and it worked fine.
Regards,
Bilal Nazir
05-25-2006 7:59 AM
Hi bilal,
1. Use this FM BAPI_EMPLOYEE_ENQUEUE
first, so that the pernr gets locked
and then call your bapi_absence_request.
regards,
amit m.
05-25-2006 10:18 AM
Hey Amit,
Now after executing the bapi you suggested, upon executing my BAPI i am getting a different error i.e. "A complex application error has occured".
Regards,
Bilal Nazir
05-25-2006 10:34 AM
Try to pass the Data to the BAPI properly to avoid such kind of errors....
and also read the BAPI documentation carefully.
Regards
vijay
05-25-2006 10:41 AM
use
BAPI_EMPLOYEE_ENQUEUE--lo lock
BAPI_EMPLOYEE_DEQUEUE-- to unlock
reward points if it helps
gunjan
05-25-2006 10:41 AM
Hi again,
1. It may signify that
the data in the bapi is not passed
properly.
2. Either some data is missing, or
wrong / incompatible data is going inside.
regards,
amit m.
05-25-2006 8:03 AM
The BAPI BAPI_ABSENCE_REQUEST verfies whether the Employee has been locked.If not you will get the error message "Employee / Applicant not locked yet" as you are getting now.
Use BAPI_EMPLOYEE_ENQUEUE to lock the user and then call BAPI_ABSENCE_REQUEST .
Cheers
Nishanth
05-25-2006 10:45 AM
Hi again,
1. As per the documentation of this FM,
its advisable not to use this FM,
and instead use some methods of
object BUS7007.
2. The required FM is :
BAPI_PTMGRATTABS_MNGCREATION
BAPI_PTMGRATTABS_*
BAPI_PTMGRATTABS_MNGCHANGE Change Attendances/Absences
BAPI_PTMGRATTABS_MNGCREATION BAPI: Creates Attendances/Absences
BAPI_PTMGRATTABS_MNGDELETE Delete Attendances/Absences
BAPI_PTMGRATTABS_MNGFROMWF Create/Change/Delete Attendances/Absences from Workflow
3. So, u can try to use this new FM(s) instead.
regards,
amit m.
05-25-2006 10:56 AM
hey amit ,
well your information is really good. But the thing is i am getting similar error from these BAPIz as well. Have you tried it ? It would be really helpful if you could provide me the details you put in these BAPIz so i do the exactly same thing and see that if i am still getting the same errors.
One more thing, when I am executing BAPI_EMPLOYEE_ENQUEUE i dont get any message indicating whether the employee was locked or not? Is it normal behavior of this BAPI?
Regards
Bilal
05-25-2006 11:08 AM
Hi again,
1. Is it normal behavior of this BAPI?
Ya, its the normal behaviour of bapi.
2. Have you tried it ?
Well, i have not tried this bapis.
3. Probably u could see the include file
LRHPRF1C
and check out for the usage of this bapi
and its parameters.
regards,
amit m.