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

Locking issue with RH_INSERT_INFTY

Former Member
0 Likes
841

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

2 REPLIES 2
Read only

Former Member
0 Likes
648

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

Read only

0 Likes
648

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