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

Check locked table

Former Member
0 Likes
948

Hi all.

In a Z-program I'm calling at the begining to the FM ENQUEUE_E_TABLEE. At the end I'm calling DEQUEUE_E_TABLEE.

All this had been implemented in order to prevent from another user that enter the program dealing with a spesific Z-table.

How can I check if the table is locked now or not ?

I would like to check at the first command of the program if another user is executing the program or not (and I want to do it by checking if somewhere else the Z-table had been locked..).

Regards,

Rebeka

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
895

You can check this with the function ENQUEUE_READ: parameter GNAME = Z table name

Kind regards,

Lieselot

You can check this with the function ENQUEUE_READ: parameter GNAME = Z table name

Kind regards,

Lieselot

3 REPLIES 3
Read only

Former Member
0 Likes
895

Hello,

If you want to check at the first command of the program if another user is executing use the FM:

 AUTHORITY-CHECK OBJECT  'ZABAP' ID 'EXGRP'  FIELD 'T1' .


CALL FUNCTION 'AUTHORITY_CHECK'
  EXPORTING
   USER                      = SY-UNAME
    object                    = 'ZABAP'
    field1                    = 'EXGRP'
   VALUE1                    = 'T1'

 EXCEPTIONS
   USER_DONT_EXIST           = 1
   USER_IS_AUTHORIZED        = 2
   USER_NOT_AUTHORIZED       = 3
   USER_IS_LOCKED            = 4
   OTHERS                    = 5
          .
IF sy-subrc  =  3.
 raise exception.
ENDIF.

I think this will serve your purpose...

Anil.

Edited by: Anil Kumar Reddy on Nov 17, 2009 11:29 AM

Read only

Sm1tje
Active Contributor
0 Likes
895

Try function module ENQUEUE_READ.

Read only

Former Member
0 Likes
896

You can check this with the function ENQUEUE_READ: parameter GNAME = Z table name

Kind regards,

Lieselot