Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Packing materials into HU with FM - almost there, but...

I need to do packing of materials into handling units on outbound deliveries. I can create the HU, and assign it to the delivery. Then after a lot of searching of this and other forums I found this piece of code. In my case, I use "1" in field verpo_tab-velin. Also, I have added material number, pack qty etc in the it_repack table. The big question is what to put in it_repack_sourcehu? Since I am not packing one HU into another, I would like to leave it blank, but this gives an error. If I put the same HU into both source and destination, the FM executes without errors but no packing takes place.

I have also tried to fill it_packing instead of it_repack. Same thing there, it executes without errors but no packing was performed.

w_vbkok-vbeln_vl = p_vbeln. "delivery number
w_verko-exidv = wa_vekp_pal-exidv. "HU in which you pack
APPEND w_verko TO i_verko.

CLEAR w_verpo.
w_verpo-exidv_ob = wa_vekp_pal-exidv.
w_verpo-EXIDV = wa_vekp_col-exidv.
w_verpo-velin = '3'. " 3 to pack a HU in another one, 1 to pack a material in a HU
w_verpo-vbeln = p_vbeln.
APPEND w_verpo TO i_verpo.

CLEAR i_repack.
w_repack-desthu = wa_vekp_pal-exidv. "HU in which you pack
w_repack-sourcehu = wa_vekp_col-exidv. "HU to be packed
w_repack-packhu = 'X'.
APPEND w_repack TO i_repack.

vbkok_wa = w_vbkok "delivery number
delivery = p_vbeln
prot = i_prot
verko_tab = i_verko
verpo_tab = i_verpo
it_repack = i_repack
error_message = 1

Thanks for looking, any hints would be very welcome.

Not what you were looking for? View more on this topic or Ask a question