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

problem with select

Former Member
0 Likes
379

see the below code all the selects and locking are happening on the same table xxxxx.

SELECT * FROM xxxxx

INTO TABLE i_vbeln

WHERE vbeln IN s_vbeln

AND bukrs IN s_bukrs

AND vkorg IN s_vkorg

AND vkbur IN s_vkbur

AND vkgrp IN s_vkgrp

AND auart IN s_auart.

if sy-subrc = 0.

LOOP AT i_vbeln.

CALL FUNCTION 'ENQUEUE_EXXXXX'

EXPORTING

mode_zse32 = 'X'

mandt = sy-mandt

vbeln = i_vbeln-vbeln

EXCEPTIONS

foreign_lock = 1

system_failure = 2

OTHERS = 3.

IF sy-subrc EQ 0.

*SELECT SINGLE FOR UPDATE **

FROM xxxxx

INTO i_vbeln

WHERE vbeln EQ i_vbeln-vbeln.

xxxxxxxxxxxxxxxxx

xxxxxxxxxxxxxxxxxxxx

xxxxxxxxxxxxxxxxxxxx

xxxxxxxxxxxxxxxxxxxxxx

xxxxxxxxxxxxxxxxxxxxxx

CALL FUNCTION 'DEQUEUE_EXXXXX'

EXPORTING

mode_zse32 = 'X'

mandt = sy-mandt

vbeln = i_vbeln-vbeln.

endloop.

endif.

now my question is..

is it mandatory to have the the below select for updating the table xxxxx

*SELECT SINGLE FOR UPDATE **

FROM xxxxx

INTO i_vbeln

WHERE vbeln EQ i_vbeln-vbeln.

or can i go directly with enque and deque without the above select before updating the table

2 REPLIES 2
Read only

Former Member
0 Likes
359

hi,

You can just call FM ENQUEUE_E_XXXX and DEQUEUE_E_XXXX for locking and unlocking the tables with out any select statements ..

Regards,

santosh

Read only

0 Likes
359

enque BEFORE you do your select thats essential.