• SAP setting and releasing locks


    REPORT  demo_transaction_enqueue MESSAGE-ID sabapdocu.
    
    TABLES  sflight.
    
    DATA  text(8) TYPE c.
    
    DATA  ok_code TYPE sy-ucomm.
    
    CALL SCREEN 100.
    
    MODULE init OUTPUT.
      SET PF-STATUS 'BASIC'.
      sflight-carrid = 'LH'. sflight-connid = '400'.
    ENDMODULE.
    
    MODULE exit INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    
    MODULE enqueue INPUT.
      CASE ok_code.
        WHEN 'ENQUEUE'.
          CALL FUNCTION 'ENQUEUE_EDEMOFLHT'
               EXPORTING
                    mode_sflight   = 'X'
                    carrid         = sflight-carrid
                    connid         = sflight-connid
                    fldate         = sflight-fldate
               EXCEPTIONS
                    foreign_lock   = 1
                    system_failure = 2
                    OTHERS         = 3.
    
          CASE sy-subrc.
            WHEN 0.
              MESSAGE i888 WITH 'Enqueue successful'(001).
            WHEN 1.
              text = sy-msgv1.
              MESSAGE e888 WITH 'Record already'(002) 'locked by'(003)
                                                       text.
              CALL TRANSACTION 'SM12'.
            WHEN 2 OR 3.
              MESSAGE e888 WITH 'Error in enqueue!'(004)
                                'SY-SUBRC:' sy-subrc.
          ENDCASE.
        WHEN 'DEQUEUE'.
          CALL FUNCTION 'DEQUEUE_EDEMOFLHT'
               EXPORTING
                    mode_sflight = 'X'
                    carrid       = sflight-carrid
                    connid       = sflight-connid
                    fldate       = sflight-fldate
               EXCEPTIONS
                    OTHERS       = 1.
          CASE sy-subrc.
            WHEN 0.
              MESSAGE i888 WITH 'Dequeue successful'(005).
            WHEN 1.
              MESSAGE e888 WITH 'Error in dequeue!'(006).
          ENDCASE.
        WHEN 'SM12'.
          CALL TRANSACTION 'SM12'.
      ENDCASE.
    
    ENDMODULE.
    
    MODULE select INPUT.
      CASE ok_code.
        WHEN 'SELECT'.
          SELECT * FROM sflight WHERE carrid = sflight-carrid
                                  AND connid = sflight-connid
                                  AND fldate = sflight-fldate.
          ENDSELECT.
          MESSAGE i888 WITH 'SY-SUBRC:' sy-subrc.
      ENDCASE.
    ENDMODULE.
  • 相关阅读:
    package.json和bower的参数解释
    移动端<meta>属性配置讲解(整理)
    PHP Ajax 跨域问题最佳解决方案
    svn客户端的使用
    TotoiseSVN的基本使用方法
    网页设计入门——UCASiGEM前端组寒假培训笔记
    manacher算法笔记
    【luoguP1168】中位数
    【CF848B】 Rooter's Song
    【luoguP1382】楼房
  • 原文地址:https://www.cnblogs.com/JackeyLove/p/13650667.html
Copyright © 2020-2023  润新知