码迷,mamicode.com
首页 > Windows程序 > 详细

BAPI: TRANSACTION_BEGIN的作用

时间:2017-05-27 11:00:45      阅读:252      评论:0      收藏:0      [点我收藏+]

标签:log   control   creat   erro   作用   port   status   logs   eating   

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

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.

 

BAPI: TRANSACTION_BEGIN的作用

标签:log   control   creat   erro   作用   port   status   logs   eating   

原文地址:http://www.cnblogs.com/rainysblog/p/6911244.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!