抬头:
项次:
DATA: gt_accchg TYPE TABLE OF accchg WITH HEADER LINE. gt_accchg-fdname = 'BKTXT'. "抬头文本-字段,也可以换其他字段 gt_accchg-newval = '测试抬头文本修改'. "新的值 APPEND gt_accchg . CALL FUNCTION 'FI_DOCUMENT_CHANGE' EXPORTING "i_awtyp = "参考过程 "i_awref = "参考凭证号 "i_aworg = "参考组织 "i_buzei = '003' "行项目 i_belnr = '2900000002' "会计凭证 i_bukrs = '1000' "公司代码 i_gjahr = '2023' "财年 TABLES t_accchg = gt_accchg EXCEPTIONS no_reference = 1 no_document = 2 many_documents = 3 wrong_input = 4 overwrite_creditcard = 5 OTHERS = 6. IF sy-subrc <> 0. CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'. ELSE. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING wait = 'X'. ENDIF. CLEAR:gt_accchg, gt_accchg[]. gt_accchg-fdname = 'SGTXT'. "行项目文本,也可以换其他字段 gt_accchg-newval = '测试项目文本修改'. "新的值 APPEND gt_accchg. *******gt_accchg-fdname = 'ZUONR'. "行项目分配,也可以换其他字段 *******gt_accchg-newval = '20230812'. "新的值 *******APPEND gt_accchg. CALL FUNCTION 'FI_DOCUMENT_CHANGE' EXPORTING "i_awtyp = "参考过程 "i_awref = "参考凭证号 "i_aworg = "参考组织 i_buzei = '003' "行项目 i_belnr = '2900000002' "会计凭证 i_bukrs = '1000' "公司代码 i_gjahr = '2023' "财年 TABLES t_accchg = gt_accchg EXCEPTIONS no_reference = 1 no_document = 2 many_documents = 3 wrong_input = 4 overwrite_creditcard = 5 OTHERS = 6. IF sy-subrc <> 0. CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'. ELSE. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING wait = 'X'. ENDIF.
标签:FUNCTION,accchg,会计凭证,ABAP,gt,CALL,文本 From: https://www.cnblogs.com/seven1314pp/p/17623493.html