‎2010 Mar 18 9:30 AM
Hi,
My requirement is to move some HU within one plant from one storage loc to another storage loc.
for same purpose i am using HU_CREATE_GOODS_MOVEMENT.
now i am passing following parameters in internal table IT_MOVE_TO.
matnr
charg
werks
lgort ( destination storage loc)
and
in IT_EXTERNAL_ID, external handing unit number which has to be moved.
could you send me a sample code ? what parameters has to be passed ?
Thanks,
Satendra
‎2010 Mar 31 3:12 PM
Hi
Sample code for FM HU_CREATE_GOODS_MOVEMENT follows:
CALL FUNCTION 'HU_CREATE_GOODS_MOVEMENT'
EXPORTING
if_event = p_huwbevent
if_commit = ' '
if_tcode = 'VLMOVE'
it_move_to = li_move_to
it_external_id = li_external_id
IMPORTING
ef_posted = li_posted
es_message = li_message
et_messages = li_messages
ES_EMKPF = li_emkpf.
CHANGING
CT_IMSEG =
COMMIT WORK AND WAIT.
**********************************************************************
where,
p_huwbevent - process code for movement type (any)
*Process code for Movement 453
select single huwbevent into p_huwbevent
from THUWBBWART where stock_cat = 'R' and
move_type = c_good_mvt_453.
'VLMOVE' is the transaction code
"li_move_to" - is a workarea with plant and storage location data
"li_external_id" - is handling unit number
************************************************************************
Hope this help's you......
‎2010 Mar 31 3:32 PM
Hi,
Please check the following code:
SORT i_huitem BY hu_item_number hu_item_type obj_item_number .
READ TABLE i_huitem INDEX 1 INTO w_huitem.
IF sy-subrc EQ 0.
wa_move-matnr = w_huitem-material.
wa_move-werks = t001w-werks.
wa_move-lgort = t001l-lgort.
wa_move-sobkz = w_huitem-spec_stock.
wa_move-sonum = w_huitem-sp_stck_no.
wa_move-huwbevent = c_0007.
wa_move-bwart = c_301 .
ENDIF.
APPEND wa_move TO i_move.
wa_external-exidv = vekp-exidv.
APPEND wa_external TO i_external.
CALL FUNCTION 'HU_CREATE_GOODS_MOVEMENT'
EXPORTING
if_tcode = c_vlmove
it_move_to = i_move
it_external_id = i_external
IMPORTING
ef_posted = is_posted
et_messages = i_huitem_messages.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = c_x.
Hope it will help you.
Thanks & regards
Rocky Agarwal
9225545815