BAPI_GOODSMVT_CREATE 创建入库单(MIGO)
2011-04-24 14:36:16| 分类:
BAPI
| 标签:
|举报
|字号大中小 订阅
report z_test_bapi_migo.
*---Data Define for BAPI
data: goodsmvt_header type bapi2017_gm_head_01,
goodsmvt_code type bapi2017_gm_code,
goodsmvt_headret type bapi2017_gm_head_ret,
materialdocument type bapi2017_gm_head_ret-mat_doc,
matdocumentyear type bapi2017_gm_head_ret-doc_year,
goodsmvt_item type standard table of bapi2017_gm_item_create,
w_goodsmvt_item type bapi2017_gm_item_create,
return type standard table of bapiret2,
w_return type bapiret2.
goodsmvt_header-pstng_date = sy-datum.
goodsmvt_header-doc_date = sy-datum.
goodsmvt_code = '01'.
clear: goodsmvt_headret,materialdocument,matdocumentyear,return.
w_goodsmvt_item-plant = '1001'. "工厂
w_goodsmvt_item-stge_loc = '1000'. "库存地点
w_goodsmvt_item-move_type = '101'. "移动类型
w_goodsmvt_item-entry_qnt = '100'. "数量
w_goodsmvt_item-entry_uom = 'KG'. "单位
w_goodsmvt_item-po_number = '4500000593'. "采购订单
w_goodsmvt_item-po_item = '00010'. "行项目号
w_goodsmvt_item-mvt_ind = 'B'. "移动标识
w_goodsmvt_item-batch = '20100101'. "批次
append w_goodsmvt_item to goodsmvt_item.
*---Call BAPI Function
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = goodsmvt_header
goodsmvt_code = goodsmvt_code
importing
goodsmvt_headret = goodsmvt_headret
materialdocument = materialdocument
matdocumentyear = matdocumentyear
tables
goodsmvt_item = goodsmvt_item
return = return.
*---Write Docuemnt or Error message
if materialdocument is not initial.
call function 'BAPI_TRANSACTION_COMMIT'.
write:/ materialdocument.
else.
loop at return into w_return.
write:/ w_return-type,
w_return-id,
w_return-number,
w_return-message.
endloop.
endif.
评论这张
转发至微博
转发至微博
评论