‎2008 Jun 17 7:17 AM
Hi experts,
I am updating HRP1001 table for cost center change and Org Unit change for a position in a BACKGROUND process (by RFC)
I am doing this by looping through an itab of 1001 type and calling RH_INSERT_INFTY.
But, this is failing becoz, I am getting a lock error after updating Org unit. If I change the order of the itab 1001, the cost center will get updated but org unit fails due to a lock error.
This is troubling me alot.
Can anyone please suggest some solution for this?
I hope this is not problem with function module, becoz in other scenario, I am using the same function and is working OK.
Thanks in advance
Mark
‎2008 Jun 17 7:52 AM
Mark,
Check whether the table is locked, using
call function 'ENQUEUE_READ'
exporting
gclient = gclient -> pass Client
guname = guname -> pass User Name
gname = gname -> Pass Table name
garg = garg
importing
subrc = subrc
tables
enq = enq -> this table will be filled if the HRP1001 table is locked
exceptions
others = 1.
loop at enq.
if enq-gname eq 'HRP1001'.
*sleep for 10 sec
CALL FUNCTION 'ENQUE_SLEEP'
EXPORTING
SECONDS = 10
EXCEPTIONS
SYSTEM_FAILURE = 1
OTHERS = 2.
endif.
endloop.
Hope it helps.
Regards,
Dhana
‎2008 Jun 17 5:40 PM
Hi all,
i was able to overcome the locking issue by passing all records for one position in an internal table, instead of looping through table and calling RH_INSERT_INFTY each time.
Thank you
Mark