‎2010 Mar 09 3:09 PM
Hi all,
I am using three functions to modify an employee infotype (0002), but the BAPI_EMPLOYEE_ENQUEUE "failed" ; i dont know where is the problem so anybody help me-> here is the code:
DATA: ls_employee like line of p0002.
DATA: w_bapireturn LIKE bapireturn1.
DATA: w_bapipakey LIKE bapipakey OCCURS 0 WITH HEADER LINE.
......
ls_employee-vorna = 'BRAD'.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = ls_employee-pernr " (Matricule of employee)
IMPORTING
return = w_bapireturn.
IF w_bapireturn-id NE space.
WRITE: / 'Enqueue failed'.
ENDIF.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0002'
number = ls_employee-pernr
record = ls_employee
validitybegin = ls_emplyee-begda
validityend = ls_employee-endda
operation = 'MOD'
IMPORTING
return = w_bapireturn
key = w_bapipakey.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = ls_employee-pernr
IMPORTING
return = w_bapireturn.
Edited by: Jcrios on Mar 9, 2010 3:10 PM
Edited by: Jcrios on Mar 9, 2010 3:11 PM
‎2010 Mar 09 3:12 PM
This BAPI might fail if the employee is already locked for some reason. Check SM12 and see if there is a lock on the employee.
‎2010 Mar 09 3:12 PM
This BAPI might fail if the employee is already locked for some reason. Check SM12 and see if there is a lock on the employee.
‎2010 Mar 09 3:17 PM
Thank U a lot Pedro I ll keep you informed even is this the problem
‎2010 Mar 09 4:02 PM
‎2010 Mar 09 4:05 PM
Use FM 'ENQUEUE_EPPRELE' directly instead of BAPI.
CALL FUNCTION 'ENQUEUE_EPPRELE'
EXPORTING
PERNR = pu_pernr
MODE_PREL = 'E'
EXCEPTIONS
FOREIGN_LOCK = 2
SYSTEM_FAILURE = 3.
See if this works.
‎2010 Mar 09 4:13 PM
Hi Pedro !
I used this code but still doesn t work :
CALL FUNCTION 'ENQUEUE_EPPRELE'
EXPORTING
PERNR = ls_employee-pernr
MODE_PREL = 'E'
EXCEPTIONS
FOREIGN_LOCK = 2
SYSTEM_FAILURE = 3.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0002'
number = ls_employee-pernr
record = ls_employee
validityend = ls_employee-endda
validitybegin = ls_employee-begda
operation = 'MOD'
DIALOG_MODE = '1'
IMPORTING
return = w_return
key = record_key.
‎2010 Mar 09 4:16 PM
‎2010 Mar 09 4:39 PM
I exucuted the debugger ! and it returs 0 for both ENQUEUE_EPPRELE and HR_INFOTYPE_OPERATION
‎2010 Mar 09 5:01 PM
‎2010 Mar 10 8:30 AM
Thanx Pedro ,
But the modification still dont work at all ! i tried the
update PA0002 set natio = 'kqjks' where pernr = ls_employee-pernr-> it s work but the FM doesn t! i dont know where is the problem ! I'm stuck .. so anybody help
‎2010 Mar 10 8:32 AM
Thanx Pedro ,
But the modification still dont work at all ! i tried the
update PA0002 set natio = 'kqjks' where pernr = ls_employee-pernr-> it s work but the FM doesn t! i dont know where is the problem ! I'm stuck .. so anybody help
‎2010 Mar 10 8:34 AM
Thanx Pedro ,
But the modification still dont work at all ! i tried the
update PA0002 set natio = 'kqjks' where pernr = ls_employee-pernr-> it s work but the FM doesn t! i dont know where is the problem ! I'm stuck .. so anybody help