on 05-26-2009 6:06 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
resolveed...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you all... This is great to see your responses.. I'm trying it and getting back to forum
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
According to my knowledge you first need to lock the employee before making any changes to the employee records. I suggest you try the bapi BAPI_EMPLOYEE_ENQUEUE before calling the bapi for absence creation. The above mentioned bapi will lock the employee so that no other user can maintain data for that employee. After the above process (once absence is created) you need to unlock the employee, so use the bapi BAPI_EMPLOYEE_DEQUEUE for the same. So in short the order of execution should be:
- BAPI_EMPLOYEE_ENQUEUE
- BAPI_ABSENCE_CREATE
- BAPI_EMPLOYEE_DEQUEUE
I also suggest that you use commit statement after every bapi call.
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Muhammed,
Lock the employee using the BAPI 'BAPI_EMPLOYEE_ENQUEUE' before using the BAPI 'Bapi_Absence_Create '.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.