** 完成后先不提交 或者 回滚,记录下消息,
CALL FUCNTION ‘BAPI_ACC_DOCUMENT_POST‘ ** 继续自建表更新逻辑: UPDATE zfit640_s SET status1 = gs_zfit640_s-status1 bukrs1 = gs_zfit640_s-bukrs1 belnr1 = gs_zfit640_s-belnr1 budat1 = gs_zfit640_s-budat1 message1 = gs_zfit640_s-message1 zdate = gs_zfit640_s-zdate "ADD BY YANGC AT 20171115 FOR 肖克 ztime = gs_zfit640_s-ztime WHERE oms_item = gs_zfit640_s-oms_item AND servercode = gs_zfit640_s-servercode. IF sy-subrc EQ 0. CLEAR gs_return. CALL FUNCTION ‘BAPI_TRANSACTION_COMMIT‘ EXPORTING wait = ‘X‘ IMPORTING return = gs_return. IF gs_return-type = ‘E‘. CALL FUNCTION ‘BAPI_TRANSACTION_ROLLBACK‘. CLEAR: gs_zfit640_s-bukrs1,gs_zfit640_s-budat1,gs_zfit640_s-belnr1. gs_zfit640_s-status1 = ‘E‘. CONCATENATE gs_zfit640_s-message1 ‘提交数据失败‘ INTO gs_zfit640_s-message1 SEPARATED BY ‘ ‘. ENDIF. ELSE. ROLLBACK WORK. CLEAR: gs_zfit640_s-bukrs1,gs_zfit640_s-budat1,gs_zfit640_s-belnr1. gs_zfit640_s-status1 = ‘E‘. CONCATENATE gs_zfit640_s-message1 ‘过账状态数据更新到ZFIT1025表失败‘ INTO gs_zfit640_s-message1 SEPARATED BY ‘ ‘. ENDIF.
原文地址:https://www.cnblogs.com/rainysblog/p/8537292.html
时间: 2024-10-19 01:59:41