zoukankan      html  css  js  c++  java
  • BAPI: TRANSACTION_BEGIN的作用

    大概知道是启动一个新会话,

    CALL FUNCTION 'TRANSACTION_BEGIN'

    业务数据处理,

    CALL FUNCTION 'TRANSACTION_END'

    详细功能不清楚。

          CLEAR G_TRANSACTION_ID.
    
    **1.Transaction control for BAPIs
          CALL FUNCTION 'TRANSACTION_BEGIN'
            IMPORTING
              TRANSACTION_ID = G_TRANSACTION_ID.
    **2.BAPIs for Creating/Changing Matl Data
          CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
            EXPORTING
              HEADDATA       = WA_HEADER
              PLANTDATA      = WA_MARC
              PLANTDATAX     = WA_MARCX
              VALUATIONDATA  = WA_MBEW
              VALUATIONDATAX = WA_MBEWX
            TABLES
              RETURNMESSAGES = IT_RETURN.
    
          READ TABLE IT_RETURN WITH KEY TYPE = 'E'.
          IF SY-SUBRC EQ 0.
    *get reprocess data and error log
            MOVE-CORRESPONDING IT_UPLOAD TO IT_ELOG.
            MOVE IT_RETURN-MESSAGE TO IT_ELOG-REASON.
            APPEND IT_ELOG.
          ELSE.
    *get successful log
            MOVE-CORRESPONDING IT_UPLOAD TO IT_SLOG.
            APPEND IT_SLOG.
            CALL FUNCTION 'TRANSACTION_STATUS'
              IMPORTING
                STATUS = G_STATUS_OF_TRANSACTION.
            IF G_STATUS_OF_TRANSACTION = 'COMMIT_WORK'.
              COMMIT WORK AND WAIT.
            ENDIF.
            CALL FUNCTION 'TRANSACTION_END'
              EXPORTING
                TRANSACTION_ID = G_TRANSACTION_ID.
    
          ENDIF.
  • 相关阅读:
    POJ 2342
    SHU 413
    SHU 414
    进制转换模板
    SHU 第15届上海大学程序设计联赛夏季赛[热身赛] 第三题(G题)
    POJ 3185
    XTU 1260
    高斯消元法模板
    POJ 2057
    模态窗口的定时关闭
  • 原文地址:https://www.cnblogs.com/rainysblog/p/6911244.html
Copyright © 2011-2022 走看看