程序单次只允许一次执行的SAP 锁

START-OF-SELECTION.
  CALL FUNCTION 'ENQUEUE_ESRDIRE'
    EXPORTING
      name           = sy-repid
      _scope         = '1'
    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.

 

 

 

posted @ 2018-05-26 13:58  追寻无限  阅读(208)  评论(0编辑  收藏  举报