日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

创建总账科目类型会计凭证

發布時間:2025/3/20 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 创建总账科目类型会计凭证 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

data:?i_bukrs?like?t001-bukrs?????value?'1000',???????"公司代碼
??????i_netwr?like?vbap-netwr?????value?1,????????????"金額
??????i_saknr?like?zsdt015-hkont??value?'0066021001'.?"總賬科目

perform?frm_create_bkpf?using?i_bukrs?i_netwr?i_saknr.
*&---------------------------------------------------------------------*
*&??????Form??frm_create_bkpf
*&---------------------------------------------------------------------*
form?frm_create_bkpf?using?i_bukrs?i_netwr?i_saknr.

*-----------------------?Data?definition?-------------------------------
??data:?lw_documentheader????type?bapiache09,???????????"憑證抬頭
????????l_obj_type???????????type?bapiache09-obj_type,
????????l_obj_key????????????type?bapiache09-obj_key,
????????l_obj_sys????????????type?bapiache09-obj_sys,

????????lt_accountgl?????????type?table?of?bapiacgl09,??"總賬科目項
????????lw_accountgl?????????type?bapiacgl09,


????????lt_currencyamount????type?table?of?bapiaccr09,??"貨幣項目
????????lw_currencyamount????type?bapiaccr09,

????????lt_return????????????type?table?of?bapiret2,
????????lw_return????????????type?bapiret2,

????????lt_extension2????????type?table?of?bapiparex,???"參考結構
????????lw_extension2????????type?bapiparex,

????????lc_msg_temp??????????type?string.
*-----------------------?header?----------------------------------------
??lw_documentheader-bus_act????=?'RFBU'.?????????????????????"業務事務
??lw_documentheader-username???=?sy-uname.???????????????????"用戶
??lw_documentheader-comp_code??=?i_bukrs.????????????????????"公司代碼

??lw_documentheader-doc_date???=?sy-datum.???????????????????"憑證中的憑證日期
??lw_documentheader-pstng_date?=?sy-datum.???????????????????"憑證中的記帳日期
??lw_documentheader-doc_type???=?'SA'.???????????????????????"憑證類型,DZ:客戶付款,SA:總賬科目憑證
??lw_documentheader-header_txt?=?'費用記賬-收款單創建'.???????"憑證抬頭文本,這個必須要帶上才能創建成功
*-----------------------?Item?------------------------------------------
*---貨幣項目
??lw_currencyamount-itemno_acc?=?1.??????????????????????????"行項目
??lw_currencyamount-currency???=?'CNY'.??????????????????????"貨幣
??lw_currencyamount-amt_doccur?=?i_netwr.????????????????????"金額
??append?lw_currencyamount?to?lt_currencyamount.

??lw_currencyamount-itemno_acc?=?2.??????????????????????????"行項目
??lw_currencyamount-currency?=?'CNY'.????????????????????????"貨幣
??lw_currencyamount-amt_doccur?=?0?-?i_netwr.????????????????"金額
??append?lw_currencyamount?to?lt_currencyamount.

*---總賬科目
??clear?lw_accountgl.
??lw_accountgl-itemno_acc?=?1.???????????????????????????????"行項目
??lw_accountgl-gl_account?=?'0066021501'.????????????????????"總帳科目
??lw_accountgl-comp_code??=?i_bukrs.?????????????????????????"公司代碼
??lw_accountgl-costcenter?=?'1000210056'.????????????????????"成本中心
??append?lw_accountgl?to?lt_accountgl.

??clear?lw_accountgl.
??lw_accountgl-itemno_acc?=?2.???????????????????????????????"行項目
??lw_accountgl-gl_account?=?'0021910012'.????????????????????"總帳科目,?
??lw_accountgl-comp_code??=?i_bukrs.?????????????????????????"公司代碼
??append?lw_accountgl?to?lt_accountgl.

*---擴展結構
??data:?lw_field_enhance?type?zfi_e_001.
??lw_field_enhance-posnr?=?2.
??lw_field_enhance-zz0001?=?'1201'.

??lw_extension2-structure?=?'ZFI_E_001'.
??lw_extension2-valuepart1?=?lw_field_enhance.
??append?lw_extension2?to?lt_extension2.


*---call?bapi
??call?function?'BAPI_ACC_DOCUMENT_POST'
????exporting
??????documentheader?=?lw_documentheader
????importing
??????obj_type???????=?l_obj_type
??????obj_key????????=?l_obj_key
??????obj_sys????????=?l_obj_sys
????tables
??????accountgl??????=?lt_accountgl
??????currencyamount?=?lt_currencyamount
??????return?????????=?lt_return
??????extension2?????=?lt_extension2.

*---處理BAPI返回結果
??delete?lt_return?where?type?=?'S'?or?type?=?'I'?or?type?=?'W'.
??if?lt_return?is?initial.
????call?function?'BAPI_TRANSACTION_COMMIT'
??????exporting
????????wait?=?'X'.
*????p_belnr?????=?l_obj_key(10).
??else.
????call?function?'BAPI_TRANSACTION_ROLLBACK'.
??endif.

endform.????????????????????"?FRM_CREATE_BKPF

總結

以上是生活随笔為你收集整理的创建总账科目类型会计凭证的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。