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: 

Function Module BAPI_ABSENCE_CREATE for creating leave request.

Former Member
0 Kudos
1,911

Hi Experts,

I am using FM BAPI_ABSENCE_CREATE for creating leave request. I am passing all the data into this as import parameter. When i am executing this return table gives statement EPG184Employee/applicant is not locked yet

Please let me know what i have to follow.

Thanks And Regards

Ranjeet Singh

7 REPLIES 7

Former Member
0 Kudos
483

Ranjeet,

check the BAPI documentation

Messages are returned in the RETURN parameter. The parameter documentation contains the return codes and their meanings.

The key fields used by this method are described under the parameters.

This method can only be used if the ENQUEUE method has already been called up for the business object EMPLOYEE. For more information on the ENQUEUE method, please see the documentation on the function module BAPI_EMPLOYEE_ENQUEUE.

Thanks

Bala Duvvuri

Former Member
0 Kudos
483

Hi,

Before you call the BAPI to update the data use BAPI BAPI_EMPLOYEE_ENQUEUE to lock the employee so that mean time no one else update the data.

Then call the BAPI BAPI_ABSENCE_CREATE

Then unlock the employee with BAPI BAPI_EMPLOYEE_DEQUEUE, Unlock employee

You may also refer links below

0 Kudos
483

Hi,

Now it showing 055Fill in all required entry fields in the return table. Even i filled all the fields.

Thanks And Regards

Ranjeet Singh

0 Kudos
483

Did you pass all the required parameters ?

1) Employeenumber

2) Validitybegin

3) Validityend

4) Absencetype

former_member196280
Active Contributor
0 Kudos
483

Use the below function modules in sequence

1) HR_EMPLOYEE_ENQUEUE'

2) BAPI_ABSENCE_CREATE

3) HR_EMPLOYEE_DEQUEUE

Functionality

Using this method, an Absences infotype record (2001) can be created.

Notes

Messages are returned in the RETURN parameter. The parameter documentation contains the return codes and their meanings.

The key fields used by this method are described under the parameters.

This method can only be used if the ENQUEUE method has already been called up for the business object EMPLOYEE. For more information on the ENQUEUE method, please see the documentation on the function module BAPI_EMPLOYEE_ENQUEUE.

Note: Create absence

Caution! This API method only writes the Absences infotype (2001). It should no longer be used as it can lead to inconsistent time data. Instead, please use the corresponding 'ManageCreation' API method for business object BUS7007.

Regards,

SaiRam

0 Kudos
483

Dear Sai Ram,

Thank you for your valuable reply.

I can create the absence of employee in SAP using BAPI.

But my problem is sometimes I am getting blank message in RETURN.

How can I display correct RETURN message in VB.NET.

I used following method for displaying RETURN value after calling "BAPI_ABSENCE_CREATE"

Dim output As Object

output = callBapi.imports("RETURN")

MsgBox(output ("MESSAGE").ToString())

0 Kudos
483

hI hishafi ,

Can u please tell me how u solved the issue ,

I was getting "EPG184Employee/applicant is not locked yet " then I used BAPI_EMPLOYEE_ENQUEUE & BAPI_EMPLOYEE_DEQUEUE, and now in the return table i get the message "055Fill in all required entry fields", but i have specified all the mandatory fields.

Thanks in advance.

Sudhish