Application Development and Automation 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: 
Read only

Error in BAPI_ABSENCE_REQUEST

Former Member
0 Likes
1,009

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

9 REPLIES 9
Read only

Former Member
0 Likes
930

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.

Read only

0 Likes
930

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

Read only

0 Likes
930

Try to pass the Data to the BAPI properly to avoid such kind of errors....

and also read the BAPI documentation carefully.

Regards

vijay

Read only

0 Likes
930

use

BAPI_EMPLOYEE_ENQUEUE--lo lock

BAPI_EMPLOYEE_DEQUEUE-- to unlock

reward points if it helps

gunjan

Read only

0 Likes
930

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.

Read only

nishanthbhandar
Contributor
0 Likes
930

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

Read only

Former Member
0 Likes
930

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.

Read only

0 Likes
930

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

Read only

0 Likes
930

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.