02-04-2011 1:00 PM
Hi Experts,
I am facing issues now using the FM HR_INFOTYPE_OPERATION as it returns me the message "Personal Number not yet assigned". I am not sure what I am missing because this is a new hire and am trying to update all the infortypes from a upload file.
LOOP AT gt_tempout INTO wa_tempout WHERE status EQ 'I'.
wa_ip0000-pernr = wa_tempout-pernr.
wa_ip0000-endda = wa_tempout-endda.
wa_ip0000-begda = wa_tempout-begda.
wa_ip0000-massn = wa_tempout-massn.
IF NOT wa_ip0000 IS INITIAL.
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
number = wa_ip0000-pernr
IMPORTING
RETURN = return2
LOCKING_USER =
.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0000'
number = wa_ip0000-pernr
SUBTYPE =
OBJECTID =
LOCKINDICATOR =
VALIDITYEND =
VALIDITYBEGIN =
RECORDNUMBER =
record = wa_ip0000
operation = 'INS'
TCLAS = 'A'
DIALOG_MODE = '1'
NOCOMMIT = ''
VIEW_IDENTIFIER =
SECONDARY_RECORD =
IMPORTING
RETURN = return1
"KEY = key
.
CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
EXPORTING
number = wa_ip0000-pernr
IMPORTING
RETURN =
.
updated record
IF return2 IS INITIAL.
IF return1 IS INITIAL.
wa_i_udata-pernr = wa_ip0000-pernr.
wa_i_udata-message = c_updated.
APPEND wa_i_udata TO gt_i_udata.
CLEAR wa_i_udata.
ELSE.
wa_i_undata-pernr = wa_ip0000-pernr.
wa_i_undata-message = return1-message.
APPEND wa_i_undata TO gt_i_undata.
ENDIF.
CLEAR wa_i_undata.
ELSE.
not updated record - BAPI_ENQUEUE failed - Object locked
wa_i_undata-pernr = wa_ip0000-pernr.
wa_i_undata-message = c_oblck.
"object locked
APPEND wa_i_undata TO gt_i_undata.
ENDIF.
CLEAR wa_i_undata.
"endif.
ENDIF.
02-04-2011 1:12 PM
HR_INFOTYPE_OPERATION FM can only be Used with exsisting employees,
to create a new employe use HRPSES40
02-04-2011 1:40 PM
02-04-2011 4:27 PM
02-04-2011 7:25 PM
HRPSES40 is a transaction create a new employee usian a call transaction or Batch Input to this transaction use SM35 trasaction to make a Record
02-09-2011 11:23 AM
Hi Ortiz,
I tried creating bdc session to copy the PA30 action creating a new employee but somehow when I transfer it to my codes it doesnt seem to work. Are you saying the only way out is via BDC?
02-09-2011 11:33 AM
to create a new employee use HRPBSES40 Transaction and complete requiered fields
02-10-2011 1:37 AM
Hi Ortiz,
I dont have this transaction available in the sytem, there should be a program assigned to it right?Can I have the programe name if its a standard one or the source code to refer?