都知道财务预算创建凭证FMBB
如果批量创建的话,使用BAPI
BAPI_0050_CREATE
或者FM
FMKU_0050_CREATE
其实FM就是BAPI的内容
还有的系统会报错如下(注意大部分问题出现在新系统中)
使用FMBB增加预算报错
FMBD_UPDATE_TOTALS
program: LGLIUU01
error: 00 671: procesador ABAP: PERFORM_NOT_FOUND
解决方法:
执行程序RGZZGLUX,生成FI-SL结构即可。
BAPI 用法如下:
代码语言:javascript复制CALL FUNCTION 'BAPI_0050_CREATE'
EXPORTING
language = sy-langu
header_data = wa_header_data
header_data_add = wa_header_data_add
testrun = p_test
TABLES
item_data = it_item_data
sender_item_data = it_sender_item_data
period_data = it_period_data
sender_period_data = it_sender_period_data
long_text = ti_long
extension_in = ti_ext
return = ti_return.
LOOP AT ti_return INTO wa_return.
wa_messages-msgtyp = wa_return-type.
wa_messages-msgspra = sy-langu.
wa_messages-msgid = wa_return-id.
wa_messages-msgnr = wa_return-number.
wa_messages-msgv1 = wa_return-message_v1.
wa_messages-msgv2 = wa_return-message_v2.
wa_messages-msgv3 = wa_return-message_v3.
wa_messages-msgv4 = wa_return-message_v4.
APPEND wa_messages TO it_messages.
ENDLOOP.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = it_return2.
ENDIF.
CLEAR: v_end.
ENDLOOP.