form frm_create_bkpf using i_bukrs i_kunnr i_wrbtr i_saknr. data: lwa_documentheader type bapiache09, lit_accountgl type table of bapiacgl09,"G/L account item lwa_accountgl type bapiacgl09, lit_accountreceivable type table of bapiacar09,"Customer Item lwa_accountreceivable type bapiacar09, lit_currencyamount type table of bapiaccr09,"Currency Items lwa_currencyamount type bapiaccr09, lit_return type table of bapiret2, lwa_return type bapiret2, lit_extension2 type table of bapiparex, lwa_extension2 type bapiparex, l_obj_type type bapiache09-obj_type, l_obj_key type bapiache09-obj_key, l_obj_sys type bapiache09-obj_sys, lc_msg_temp type string.
*---处理BAPI返回结果 loop at lit_return into lwa_return. if lc_msg_temp is initial. concatenate lwa_return-type ':' lwa_return-message into lc_msg_temp. else. concatenate lc_msg_temp ';'lwa_return-type ':' lwa_return-message into lc_msg_temp. endif. endloop. "获取消息类别:成功还是失败 delete lit_return where type = 'S' or type = 'I' or type = 'W'. if lit_return is initial."成功 call function 'BAPI_TRANSACTION_COMMIT' exporting wait = 'X'.
else."失败 call function 'BAPI_TRANSACTION_ROLLBACK'. endif.
endform. " FRM_CREATE_BKPF
*&---------------------------------------------------------------------* *& Form frm_process_itemdata *&---------------------------------------------------------------------* form frm_process_itemdata tables f_t_accountgl structure bapiacgl09 f_t_accountreceivable structure bapiacar09 f_t_currencyamount structure bapiaccr09 f_t_extension2 structure bapiparex using i_kunnr i_wrbtr i_saknr. data: lwa_accountgl type bapiacgl09, lwa_accountreceivable type bapiacar09, lwa_currencyamount type bapiaccr09, lwa_extension2 type bapiparex, lwa_field_enhance type zfi_e_001.
评论