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

DEQUEUE_E_TABLE is not working

Former Member
0 Likes
3,395

Hi All,

We have a locked a Ztable by using the FM "ENQUEUE_E_TABLE" and the in SM12 we can see that the table is locked.

We are unlocking the ztable by uing the FM "DEQUEUE_E_TABLE" but when we check in SM12 the loked entery is not unlocked .can any one help us what is the issue with "DEQUEUE_E_TABLE " FM.

Regards

-


cb

11 REPLIES 11
Read only

Former Member
0 Likes
2,079

Hi ,

Is any one has idea,what would be the issue.

Regards

-


cb

Read only

Former Member
0 Likes
2,079

In case your dequeue F.M is not working use

DEQUEUE_ALL

Regards

Bhanu

Read only

0 Likes
2,079

Hi Bhanu,

thanks for your reply, but i checked the DEQUEUE_ALL , it is also not working.

Regards

-


cb

Read only

0 Likes
2,079

hi,

Try this FM DEQUEUE_EMI_LOCKTABLE

hope this helps

Regards

Ritesh

Read only

0 Likes
2,079

Hi Rithesh,

thanks for your reply,

but this FM is not working.

Regards

-


cb

Read only

Former Member
0 Likes
2,079

can you please share your code?

Read only

0 Likes
2,079

Hi ,

for locking

FORM F_LOCK_TABLE  USING    P_GV_TABLE_NAME.
  DATA : lv_varkey TYPE rstable-varkey.
  lv_varkey = sy-mandt.

    CALL FUNCTION 'ENQUEUE_E_TABLE'
     EXPORTING
       TABNAME              = P_GV_TABLE_NAME
       VARKEY               = lv_varkey
     EXCEPTIONS
       FOREIGN_LOCK         = 1
       SYSTEM_FAILURE       = 2
       OTHERS               = 3.
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
ENDFORM.   


for unlocking


*----------------------------------------------------------------------*
FORM F_UNLOCK_TABLE  USING    P_GV_TABLE_NAME.
CALL FUNCTION 'DEQUEUE_E_TABLE'
 EXPORTING
   TABNAME            = P_GV_TABLE_NAME.
ENDFORM.

between this we are doing chages to ztable.

Regards

-


cb

Read only

Former Member
0 Likes
2,079

Try FM 'DEQUEUE_ALL'.

This will dequeue all lock which are acquired by respective program.

Regards,

Sarbpreet

Read only

BH2408
Active Contributor
0 Likes
2,079

Hi,

First check weather table is locked or not. USE the FM ENQUEUE_E_TABLE

CALL FUNCTION 'ENQUEUE_E_TABLE'

EXPORTING

tabname = <table name>

EXCEPTIONS

foreign_lock = 1

system_failure = 2

OTHERS = 3.

CASE sy-subrc .

WHEN '0' . "Success

WHEN '1' .

MESSAGE e045 WITH sy-msgv1 text-018. "foreign lock

WHEN '2' .

MESSAGE e045 WITH text-019. "syst. failure

WHEN OTHERS.

MESSAGE e045 WITH text-020 . "others

ENDCASE.

then unlock the table by using FM DEQUEUE_E_TABLE

Regards,

Bharani

Read only

Former Member
0 Likes
2,079

Hi ,

I have just observed on starng thing in the lock and unlock FM

if i lock a ztable from SM37 using the FM " ENQUEUE_E_TABLEE " the table will lock ,but table will be unlocked only if we come back of the ENQUEUE_E_TABLEE session and then execute the FM "DEUEUE_E_TABLEE" then table will be unlocked the correclty.

but if use othere seesion to executre the FM "DEUEUE_E_TABLEE,, then it will not unlock.

how can we handle this.

Regards

-


cb

Read only

Former Member
0 Likes
2,079

Hi all

the issue has been resloved,the problem is with the parmeter ,we need to var key in the deque FM also.

thanks

cb