10-10-2005 4:21 PM
HI,
I need to mass migrate stocks using MB11.
is there any BAPI for creating Good Movement?
I am planning to USE LSMW batch input.
I am looking for other alternatives like BAPI's.
if anyone worked on it, pls let me know.
I promise to reward the replies
thanks
Martin
10-10-2005 4:23 PM
10-10-2005 4:23 PM
Martin,
Did you look into this BAPI - BAPI_GOODSMVT_CREATE?
Regards,
Ravi
10-10-2005 4:23 PM
10-10-2005 4:24 PM
Here is a sample of the coding....
* Structures for BAPI
data: gdsmt_header like bapi2017_gm_head_01.
data: gdsmt_code like bapi2017_gm_code.
data: gdsmt_headret like bapi2017_gm_head_ret.
data: gdsmt_item like bapi2017_gm_item_create occurs 1 with header line.
data: return like bapiret2 occurs 0.
data: retmatdoc like bapi2017_gm_head_ret-mat_doc.
* Setup BAPI header data.
gdsmt_header-pstng_date = sy-datum.
gdsmt_header-doc_date = sy-datum.
gdsmt_code-gm_code = '06'. " MB11
* Write 262 movement to table.
clear gdsmt_item.
move '262' to gdsmt_item-move_type.
move i_resb-matnr to gdsmt_item-material.
move p_bdmng to gdsmt_item-entry_qnt.
move i_resb-meins to gdsmt_item-entry_uom.
move i_resb-werks to gdsmt_item-plant.
move i_resb-lgort to gdsmt_item-stge_loc.
move i_afko-aufnr to gdsmt_item-orderid.
append gdsmt_item.
* Determine cost center
move '0000041430' to gdsmt_item-costcenter.
append gdsmt_item.
* Call goods movement BAPI
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = gdsmt_header
goodsmvt_code = gdsmt_code
importing
goodsmvt_headret = gdsmt_headret
materialdocument = retmatdoc
tables
goodsmvt_item = gdsmt_item
return = return.
Regards,
Rich Heilman
10-10-2005 4:25 PM
10-10-2005 4:30 PM