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

Problems in Enqueue

former_member343107
Participant
0 Likes
816

Hi All,

I created two programs to lock different records. But only one of them can be executed successfully. Can you help to indicate possible reason? The lock object uses 'E' lock. It has one primary table and a couple of secondary tables. But in these programs only the mode parameter corresponding to the primary table is used.

Program 1:

DATA: lv_reqkey TYPE KEYXXXXX VALUE '9998'.

CALL FUNCTION 'ENQUEUE_XXXXXX'

EXPORTING

MODE_PRIMARY_TAB = 'E'

REQKEY = lv_reqkey

X_REQKEY = ' '

_SCOPE = '2'

_WAIT = ' '

_COLLECT = ' '

EXCEPTIONS

FOREIGN_LOCK = 1

SYSTEM_FAILURE = 2

OTHERS = 3

.

BREAK-POINT.

Program 1:

DATA: lv_reqkey TYPE KEYXXXXX VALUE '9999'.

CALL FUNCTION 'ENQUEUE_XXXXXX'

EXPORTING

MODE_PRIMARY_TAB = 'E'

REQKEY = lv_reqkey

X_REQKEY = ' '

_SCOPE = '2'

_WAIT = ' '

_COLLECT = ' '

EXCEPTIONS

FOREIGN_LOCK = 1

SYSTEM_FAILURE = 2

OTHERS = 3

.

BREAK-POINT.

Thanks + Best Regards

Jerome

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
728

Check in "Lock Parameters" tab of the Lock Object definition, whether you have selected the key fields. If not, it will lock the entire table.

Hope this helps.

Thanks,

Balaji

4 REPLIES 4
Read only

Former Member
0 Likes
729

Check in "Lock Parameters" tab of the Lock Object definition, whether you have selected the key fields. If not, it will lock the entire table.

Hope this helps.

Thanks,

Balaji

Read only

0 Likes
728

Hi Balaji,

In the "Lock Parameters" tab I selected the key of the document header table. But I didn't select the key of the document item tables. (item table also has the document header key as its own key.) Is that correct?

Thanks, Jerome

Read only

0 Likes
728

Sovled by myself. The foreign key was not correctly set.

Read only

Former Member
0 Likes
728

Hi,

it is possible because of due to one of the parameters in :

_WAIT = ' '

_COLLECT = ' '

please try to put some value 'X' in one of these 2 or both and try checking whether it worked or not.

Thanks,

Vishnu.