We have implemented SAP HR OM BADI ZHR_INT_BAD_OM_INFTY and Method IN_UPDATE. Now when some users save their OM work the IN_UPDATE method is not triggered.
The problem with debugging this is that when you go into abap debugger "stuff" in the background gets committed.
Our goal is to have a list of recent OM changes for delta detection.
Example of the code we have implemented:
DATA:
lw_old_image LIKE LINE OF old_image,
lw_new_image LIKE LINE OF new_image,
ls_object TYPE hrobject.
"-- Check if there is anything interesing in the old image
LOOP AT old_image INTO lw_old_image
WHERE infty IN me->get_range_infotypes( )
AND begda LE sy-datum
AND endda GE sy-datum.
MOVE-CORRESPONDING lw_old_image TO ls_object.
"-- If an object has been detected, trigger the refresh
TRY.
zhr_cl_int_person_masterdata=>trigger_om_object_changed( zhr_cl_om_object=>get( im_plvar = ls_object-plvar
im_otype = ls_object-otype
im_objid = ls_object-objid ) ).
CATCH zcx_hr_om. " " Base class for OM objects
ENDTRY.
ENDLOOP.
"-- If nothing found, check if there is anything interesting in the new image
IF ls_object IS INITIAL.
LOOP AT new_image INTO lw_new_image
WHERE infty IN me->get_range_infotypes( )
AND begda LE sy-datum
AND endda GE sy-datum.
MOVE-CORRESPONDING lw_new_image TO ls_object.
"-- If an object has been detected, trigger the refresh
TRY.
zhr_cl_int_person_masterdata=>trigger_om_object_changed( zhr_cl_om_object=>get( im_plvar = ls_object-plvar
im_otype = ls_object-otype
im_objid = ls_object-objid ) ).
CATCH zcx_hr_om. " " Base class for OM objects
ENDTRY.
ENDLOOP.
ENDIF.