form frm_wm_goodsmov_261 .
data:
lv_err*** type char1,
lv_bdmng type resbd-bdmng,
lv_verme type lqua-verme,
i_gheader type table of bapi2017_gm_head_01 with header line ,
i_gheadret type table of bapi2017_gm_head_ret with header line ,
i_mdocument type bapi2017_gm_head_ret-mat_doc,
i_mdocyear type bapi2017_gm_head_ret-doc_year,
i_gitem type table of bapi2017_gm_item_create with header line ,
i_gsnumber type table of bapi2017_gm_serialnumber with header line,
i_return type table of bapiret2 with header line,
ls_mseg type mseg,
lt_ltak_vb type ltak_vb occurs 0 with header line,
lt_ltap_vb type ltap_vb occurs 0 with header line.
select sum( verme )
into lv_verme
from lqua
where lgnum = it_stoseq-lgnum
and matnr = it_resbd-matnr
and lgtyp = it_stoseq-lgtyp
and werks = p_werks
and sobkz <> 'k'.
if lv_verme is initial.
exit.
endif.
if lv_verme > gs_mard-labst.
lv_verme = gs_mard-labst.
endif.
concatenate sy-uname ' ' sy-tcode into i_gheader-header_txt.
i_gheader-doc_date = sy-datum.
i_gheader-pstng_date = sy-datum.
i_gitem-material = it_resbd-matnr.
i_gitem-stge_loc = it_stoseq-lgort.
i_gitem-entry_qnt = lv_bdmng.
i_gitem-entry_uom = it_resbd-meins.
i_gitem-move_type = '261'.
i_gitem-plant = it_resbd-werks.
i_gitem-orderid = it_mesyld-aufnr.
i_gitem-reserv_no = it_resbd-rsnum.
i_gitem-res_item = it_resbd-rspos.
concatenate it_mesyld-aplfl
it_mesyld-vornr
into i_gitem-gr_rcpt
separated by ','.
call function 'bapi_goodsmvt_create'
exporting
goodsmvt_header = i_gheader
goodsmvt_code = '03'
importing
goodsmvt_headret = i_gheadret
materialdocument = i_mdocument
matdocumentyear = i_mdocyear
tables
goodsmvt_item = i_gitem
goodsmvt_serialnumber = i_gsnumber
return = i_return.
貨物移動的bapi bapi_goodsmvt_create
其中 引數 : goodsmvt_code 有
gmcode table t158g - 01 - mb01 - goods receipts for purchase order
* 02 - mb31 - goods receipts for prod order
* 03 - mb1a - goods issue
* 04 - mb1b - transfer posting
* 05 - mb1c - enter other goods receipt
* 06 - mb11
* 07 - mb04
事物**mbst憑證沖銷 bapi bapi_goodsmvt_cancel
獲得憑證明細 bapi bapi_goodsmvt_getdetail
根據物料 工廠 移動型別 記賬日期 建立人 等查詢憑證 bapi bapi_goodsmvt_getitems
sap內部使用 bapi bapi_goodsmvt_sapcreate
SAP 物料移動tcode
月底,財務月結,需要關賬,關閉物料移動功能,支援財務對賬 其中一項任務是要鎖定物料移動tcode,這應該是其中部分 co27 ppiom000 1000 揀配清單 mb1a sapmm07m 400 貨物提取 mb1b sapmm07m 400 轉移過帳 mb1c sapmm07m 400 其他收貨...
MM物料移動BW資料來源介紹
mm物料移動主要的三個資料來源是 2lis 03 bf,2lis 03 bx,2lis 03 um。其中 1 2lis 03 bx,mm物料移動初始化資料來源,只在模型初始化時執行一次,作用是取出當前源系統中所有物料的庫存餘額資料 資料明細到物料 工廠 庫存地點級別 注意 當前 是指初始化bx填充表...
MM物料移動BW資料來源介紹
mm物料移動主要的三個資料來源是 2lis 03 bf,2lis 03 bx,2lis 03 um。其中 1 2lis 03 bx,mm物料移動初始化資料來源,只在模型初始化時執行一次,作用是取出當前源系統中所有物料的庫存餘額資料 資料明細到物料 工廠 庫存地點級別 注意 當前 是指初始化bx填充表...