MB01 是PO 事务的 Post GR,它相当于或中的 GM_Code 01。transaction 是过时 MB01 的现代继任者。MIGO
BAPI_GOODSMVT_CREATE
MIGO
因此,根据BAPI_GOODSMVT_CREATE
GM_Code 01 的文档,以下字段是强制性的:
- 采购订单
- 采购订单项目
- 机芯类型
- 运动指示器
- 进入单位的数量
- 输入单位或数量建议的 ISO 代码计量单位
这是示例:
gmhead-pstng_date = sy-datum.
gmhead-doc_date = sy-datum.
gmhead-pr_uname = sy-uname.
gmcode-gm_code = '01'.
loop at pcitab.
itab-move_type = pcitab-mvt_type.
itab-mvt_ind = 'B'.
itab-plant = pcitab-plant.
itab-material = pcitab-material.
itab-entry_qnt = pcitab-qty.
itab-move_stloc = pcitab-recv_loc.
itab-stge_loc = pcitab-issue_loc.
itab-po_number = pcitab-pur_doc.
itab-po_item = pcitab-po_item.
concatenate pcitab-del_no pcitab-del_item into itab-item_text.
itab-move_reas = pcitab-scrap_reason.
append itab.
endloop.
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = gmhead
goodsmvt_code = gmcode
IMPORTING
goodsmvt_headret = mthead
tables
goodsmvt_item = itab
return = errmsg