08-31-2013 11:42 AM
Hello Experts,
We have a requirement to update the job attributes and position attributes from a custom program (i.e. excel file). We tried using the BDC option but it was quite unstable Some times it goes and enters the attributes properly but some times it goes to some other screen where in we have to enter the new entries button manually and hence the bdc is getting failed.
Also we tried using the function modules RH_PNNNN_MAINTAIN but it is of no help.
Any inputs are really helpful.
Thanks,
Sanath.
09-01-2013 10:16 AM
Hi,
Try to use the following Function Modules
BAPI_EMPLOYEE_ENQUEUE
HR_INFOTYPE_OPERATION
BAPI_EMPLOYEE_DEQUEUE
Also go through below Links
http://scn.sap.com/thread/3240436
https://scn.sap.com/message/10141790
Regards
Sajid
09-01-2013 12:58 PM
Hi,
Go through the following sample code for modify the records of employee,
CONSTANTS: change TYPE pspar-actio VALUE 'MOD'.
"This code is requred and locks the record ready for modification
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
number = p_pernr.
"loop at p0071 into p_p0071. "added to put code in context
validitybegin = p_record-begda.
validityend = p_record-endda.
p_record-endda = pn-begda - 1.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0071'
subtype = p_record-subty
objectid = P_record-objps
number = p_record-pernr "employeenumber
validityend = validityend
validitybegin = validitybegin
record = p_record
recordnumber = p_record-SEQNR
operation = change
nocommit = nocommit
dialog_mode = '0'
IMPORTING
return = return_struct
key = personaldatakey
EXCEPTIONS
OTHERS = 0.
"endloop.
"unlock record after modification
CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
EXPORTING
number = p_pernr.
Regards,
John.