ABAP顾问
分类: 敏捷开发
2011-07-07 14:53:31
REPORT z_barry_test.
DATA: locked .
START-OF-SELECTION.
PERFORM checklock USING 'TRDIR' 'Z_BARRY_TEST' locked .
WRITE locked.
*&---------------------------------------------------------------------*
*& Form checklock
*&---------------------------------------------------------------------*
FORM checklock USING tablename keyname CHANGING locked.
DATA:enq TYPE STANDARD TABLE OF seqg3.
CALL FUNCTION 'ENQUEUE_READ'
EXPORTING
gclient = sy-mandt
gname = tablename
guname = ''
garg = keyname
TABLES
enq = enq
EXCEPTIONS
OTHERS = 1.
IF enq[] IS INITIAL.
locked = ''.
ELSE.
locked = 'X'.
ENDIF.
ENDFORM. "checklock