[英]BAPI_CONTRACT_CREATE error "Enter material number or account assignment category"
[英]BAPI_PO_CREATE1 Account 475000 requires an assignment to a CO object
我發現了兩個函數, BAPI_PO_CREATE
和BAPI_PO_CREATE1
。 由於CREATE1
修改日期更近,我認為這將是最好的使用。 例如,我正在創建一個沒有材料的相當簡單的購買。
call function 'BAPI_PO_CREATE1'
exporting
poheader = po_header
poheaderx = po_header_x
testrun = abap_false
tables
return = returning
poitem = po_items
poitemx = po_items_x
poaccount = po_accounts
poaccountx = po_accounts_x
poschedule = po_schedule
poschedulex = po_schedule_x.
因此,我使用總賬科目和 WBS 元素作為成本對象:
append initial line to po_accounts assigning field-symbol(<po_account>).
<po_account>-po_item = current_position.
" Classes that call CONVERSION_EXIT
<po_account>-gl_account = /dim/cl_bonadm_exit=>int_saknr( <item>-gl_account ).
<po_account>-wbs_element = /dim/cl_bonadm_exit=>int_posnr( <item>-wbs_id ).
append initial line to po_accounts_x assigning field-symbol(<po_account_x>).
<po_account_x>-po_item = current_position.
<po_account_x>-po_itemx = abap_true.
<po_account_x>-gl_account = abap_true.
<po_account_x>-wbs_element = abap_true.
但是,我繼續收到錯誤消息:
No instance of object type PurchaseOrder has been created. External reference:
Purchase order item 00010 still contains faulty account assignments
Can delivery date be met?
Account 475000 requires an assignment to a CO object
不應該是這樣,當我在 ME21n 中填寫相同的確切數據時,我仍然收到交貨日期警告,但沒有收到采購訂單項目的錯誤。 我遇到過兩種不同的 SAP 說明,但都無法實施。 同樣,即使我從帳戶中刪除 WBS 元素,我仍然收到錯誤消息。
我還嘗試在 BAPI 結構的 CO-object 字段中填充 WBS 元素,但沒有任何效果。 我可以在 BAPI 中跟蹤它拋出此錯誤消息的點,但我無法找出它發生的原因。
整個方法: http : //hastebin.com/ufarisozav.xml
您還需要填充表poaccountx
(如功能模塊的文檔所示),否則系統可能會忽略插入到poaccount
表中的部分或全部數據。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.