批量匯入憑證時,憑證的分割

2021-07-23 06:13:01 字數 1921 閱讀 5673

types : begin of ltype_cost_share,

zflag type posnr_acc, "憑證標示

bschl type bseg-bschl, "記帳**

gl_account type c001-sakn1, "科目

* doc_date type char8, "document date

* pos_date type char8, "posting date

* period type char4, "period

amount type bseg-wrbtr, "憑證中的金額

vbelv type vbfa-vbelv, "銷售訂單

posnv type vbfa-posnv, "銷售訂單行專案

sgtxt type bseg-sgtxt, "item text.

belnr type bkpf-belnr, "憑證編號

fis_period type char8, "period

fisc_year type char8, "記賬年份

messag type char300, "報訊息

end of ltype_cost_share.

data :lt_cost_share type table of ltype_cost_share,

ls_cost_share like line of lt_cost_share,

lt_display_cost type table of ltype_cost_share,

ls_display_cost like line of lt_display_cost

data: ls_cost_share2 like ls_cost_share.

data: lt_temp_cost type table of ltype_cost_share.

"// 將excel表中內容拆分憑證

clear ls_cost_share.

clear lt_temp_cost.

delete lt_cost_share where bschl is initial.

sort lt_cost_share by zflag.

clear ls_cost_share.

loop at lt_cost_share into ls_cost_share.

clear ls_cost_share.

endloop.

clear ls_cost_share.

loop at lt_cost_share into ls_cost_share.

read table lt_cost_share into ls_cost_share2 index 2.

if sy-subrc = 0. "//有下條記錄

if ls_cost_share-zflag = ls_cost_share2-zflag. "//同乙個憑證

delete lt_cost_share.

else.

"//bapi post

perform frm_bapi_post_data5 tables lt_temp_cost." tab_return.

delete lt_cost_share.

clear lt_temp_cost.

endif.

else. "// 只有一條記錄了

"//bapi post

perform frm_bapi_post_data5 tables lt_temp_cost." tab_return.

endif.

clear ls_cost_share.

endloop.

SAP憑證分割

sap憑證分割,一張原始憑證所列的支出,需要由兩個以上單位共同負擔時,應當由儲存該原始憑證的單位,開給其他應負擔支出的單位原始憑證分割單。相當於一張自製原始憑證。原始憑證分割單必須具備原始憑證的基本內容 憑證名稱 填製憑證日期 填製憑證單位名稱或者填製人姓名 經辦人的簽名或者蓋章 接受憑證單位名稱 ...

SAP 會計憑證和物料憑證的關係

會計憑證主表 bseg 會計核算憑證標題 bkpf 物料憑證清單 mseg 根據會計憑證找到相應的物料憑證 besg belnr 會計憑證號。bkpf belnr 會計憑證號。bkpf awkey 對應的物料憑證,格式為 49000792612007 其中 4900079261 為物料憑證號,200...

憑證相關的表

bankaccount paywayacc 資金類會計分錄科目對照表 vouitem 憑證分錄項定義表 vouitemacc 非資金類會計分錄科目對照表 vouitemdef 憑證分錄項名稱翻譯表 voutype 憑證型別定義表 accfeetype 財 費用型別定義表 feetypetrans 財...