‎2010 Oct 06 7:07 AM
I am calling function module to add the record in info type, i want to set a returncode if user is not authorized to access infotype
but nothing has come in wa_return even the infotype is not getting updated
data: wa_return type bapiret1.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '9077'
number = wa_p9077-pernr
validityend = wa_p9077-endda
validitybegin = wa_p9077-begda
record = wa_p9077
operation = 'INS'
IMPORTING
return = wa_return.
please guide
‎2010 Oct 06 10:54 AM
Try this code
constants: insert type pspar-actio value 'INS'.
"This code is requred and locks the record ready for modification
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
number = p_pernr.
validitybegin = p_record-begda.
validityend = p_record-endda.
p_record-pernr = p_pernr.
p_record-begda = pn-begda.
p_record-endda = validityend.
p_record-subty = p_subty. "subtype of new entry
p_record-scref = p_subty. "subtype of new entry
"plus populate any other fields you need to update
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0071'
subtype = p_record-subty
number = p_record-pernr "employeenumber
validityend = validityend
validitybegin = validitybegin
record = p_record
operation = insert
nocommit = nocommit
dialog_mode = '0'
IMPORTING
return = return_struct
key = personaldatakey
EXCEPTIONS
OTHERS = 0.
‎2010 Oct 25 8:04 AM