首页 > 代码库 > Commit 函数WAIT = 'X'.
Commit 函数WAIT = 'X'.
BAPI_TRANSACTION_COMMIT IF WAIT EQ SPACE. COMMIT WORK. ELSE. COMMIT WORK AND WAIT. IF SY-SUBRC NE 0. CALL FUNCTION ‘BALW_BAPIRETURN_GET2‘ EXPORTING TYPE = ‘E‘ CL = ‘S&‘ NUMBER = ‘150‘ IMPORTING RETURN = RETURN. ENDIF. ENDIF. CALL FUNCTION ‘BUFFER_REFRESH_ALL‘.
使用API 函数需要注意:要使用 wait = ‘X‘.
不然多条会dump
IF ex_statu NE ‘E‘.
CALL FUNCTION ‘BAPI_TRANSACTION_COMMIT‘
EXPORTING
wait = ‘X‘.
READ TABLE lt_get INTO ls_get INDEX 1.
ex_lifnr = ls_get-header-object_instance-lifnr.
ex_statu = ‘S‘.
ex_msg = ‘创建供应商成功!‘.
ELSE.
CALL FUNCTION ‘BAPI_TRANSACTION_ROLLBACK‘.
* ROLLBACK WORK.
* ex_statu = ‘E‘.
* ex_msg = ‘创建供应商失败!‘.
ENDIF.
CALL FUNCTION ‘BAPI_TRANSACTION_ROLLBACK‘. 清空缓存 很重要!!!
Commit 函数WAIT = 'X'.
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。