Skip to Content
0
May 26, 2009 at 05:06 AM

Bapi_Absence_Create BAPI not working

102 Views

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.