Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Help ! OM Infotype Update Error

Former Member
0 Likes
1,494

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.

5 REPLIES 5
Read only

RaymondGiuseppi
Active Contributor
0 Likes
857

Try to use the function module [HR_INFOTYPE_OPERATION|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=hr_infotype_operation&adv=false&sortby=cm_rnd_rankvalue].

Regards

Read only

Former Member
0 Likes
857

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

Read only

Former Member
0 Likes
857

Use Fm:- RH_RELATION_MAINTAIN -


Relation Maintain for HRP1001.

RH_PNNNN_MAINTAIN --- For all infotype (HRPXXXX).

Read only

Former Member
0 Likes
857

OR use

FM 'RH_OBJECT_CREATE for IT 1000 & FM 'RH_RELATION_MAINTAIN' for IT 1001

kr

Gab

Read only

venkat_o
Active Contributor
0 Likes
857

Hi, <li>Try this way.


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.
<li>For better information, you can go to SE37 and give this FM and check Function module documenation. Thanks Venkat.