‎2008 Aug 18 2:51 PM
We were trying to update the OM infotype using the RH_UPDATE_INFTY function module. But we are getting an exceptional error - 'ERROR DURING UPDATE'. Please help us on this.
The process which we used is.. Select the existing infotype record (IT 1029) and make modifications in some of the fields and pass the updated record to the FM.
‎2008 Aug 18 3:07 PM
‎2008 Aug 18 5:17 PM
Hi Radha,
Instead of going for RH_UPDATE_INFTY, you can go for the function module HR_INFOTYPE_OPERATION.
Before using this function module you need to LOCK using ENQUEUE_EPPRELE, so that no other person cannot make any changes to that infotype.
After the changes, you must UNLOCK the infotype using DEQUEUE_EPPRELE.
Sample:
CALL FUNCTION 'ENQUEUE_EPPRELE'
EXPORTING
pernr = wa_hrrecord-pernr
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc EQ 0.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0015'
NUMBER = P0015-PERNR
SUBTYPE = P0015-SUBTY
OBJECTID = P0015-OBJPS
LOCKINDICATOR = P0015-SPRPS
VALIDITYEND = P0015-ENDDA
VALIDITYBEGIN = P0015-BEGDA
RECORDNUMBER = P0015-SEQNR
RECORD = P0015
OPERATION = 'INS'
TCLAS = 'A'
DIALOG_MODE = '0'
IMPORTING
RETURN = RETURN
KEY = KEY.
CALL FUNCTION 'DEQUEUE_EPPRELE'
EXPORTING
pernr = wa_hrrecord-pernr.
ENDIF.
ENDLOOP.Regards,
Chandra Sekhar
‎2010 Mar 11 10:25 PM
Use Fm:- RH_RELATION_MAINTAIN -
Relation Maintain for HRP1001.
RH_PNNNN_MAINTAIN --- For all infotype (HRPXXXX).
‎2010 Mar 11 10:32 PM
OR use
FM 'RH_OBJECT_CREATE for IT 1000 & FM 'RH_RELATION_MAINTAIN' for IT 1001
kr
Gab
‎2010 Mar 12 2:56 AM
Hi,
<li>Try this way.
<li>For better information, you can go to SE37 and give this FM and check Function module documenation.
Thanks
Venkat.
DATA:lt_hrp1000 type table of p1000 with headerline.
"select the records from DB, change and pass with below information.
if not lt_hrp1000 is initial.
call function 'RH_UPDATE_INFTY'
exporting
vtask = 'D'
authy = 'X'
tables
innnn = lt_hrp1000
exceptions
error_during_update = 1
no_authorization = 2
repid_form_initial = 3
corr_exit = 4
others = 5.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endif.