cancel
Showing results for 
Search instead for 
Did you mean: 

Bapi_Absence_Create BAPI not working

babuilyas
Participant
0 Kudos

I'm trying to create an absence from asp.net web page in c sharp. But the effect is not scene on the data.

Bapi returns "Employee/applicant is not locked yet" and record is not created even after commit the bapi.

Kindly help me.

string LockIndicator, ObjectId, RecordNo,SubType;
            ThalAdmin_SAPRFC.BAPIRETURN1 BAPIRETURN1 = new ThalAdmin_SAPRFC.BAPIRETURN1();
 
            string EmployeeNo = "20001287";
            string ValidityBeging = "20090523";
            string ValidityEnd = "20090523";
 
            AbsenceCreate.Bapi_Absence_Create(
                      Convert.ToDecimal(7.5),
                      "1050",
                      "20090523",
                      "",
                      "20090523",
                      out LockIndicator,
                      out ObjectId,
                      out RecordNo,
                      out BAPIRETURN1,
                      out SubType,
                      ref EmployeeNo,
                      ref ValidityBeging,
                      ref  ValidityEnd);

            AbsenceCreate.CommitWork();

I'm trying above code.

View Entire Topic
Former Member
0 Kudos

Hi,

Before you call the BAPI to update the data use the below BAPI to lock the employee so that mean time no1 else update the data.

BAPI_EMPLOYEE_ENQUEUE Lock employee

Then call the BAPI to update the date.

Then unlock the employee with the below BAPI.

BAPI_EMPLOYEE_DEQUEUE Unlock employee

Br/Manas