Skip to Content
0
Former Member
Mar 04, 2008 at 04:49 PM

Using FM WS_DELIVERY_UPDATE to pack material in HU

3281 Views

I've been browsing the forums, and, despite the many examples available I can't put this FM to work.

The goal is to do the same thing as transaction vl02n when

- the pack button is pushed

- you pick the pack material tab

- you alter the partial quantity on one of the existing positions

- you press pack

- you save.

Last thing I've tried is something I found on Internet:

DATA:

wa_vbkok TYPE vbkok,

wa_hus TYPE TABLE OF vekpvb,

wa_pack TYPE REPACK_HU_WM OCCURS 0 WITH HEADER LINE.

wa_vbkok-vbeln = pvbeln.

wa_vbkok-vbeln_vl = pvbeln.

wa_pack-desthu = pexidv.

wa_pack-quantity = pqty.

wa_pack-meins = pmeins.

wa_pack-matnr = pmatnr.

wa_pack-charg = pcharg.

wa_pack-werks = pwerks.

wa_pack-lgort = plgort.

wa_pack-vbeln_vl = pvbeln.

wa_pack-posnr_vl = pposnr.

wa_pack-object = '01'.

wa_pack-objkey = pvbeln.

APPEND wa_pack.

CALL FUNCTION 'WS_DELIVERY_UPDATE'

EXPORTING

VBKOK_WA = wa_vbkok

SYNCHRON = 'X'

COMMIT = 'X'

DELIVERY = wa_vbkok-vbeln

TABLES

IT_PACKING = wa_pack

ET_CREATED_HUS = wa_hus

EXCEPTIONS

ERROR_MESSAGE = 1

OTHERS = 2.

Excepting pcharg which I don't have as a datum and therefore I have left empty.

I a price error determination (?) because I lack some compulsory condition ZP03.

Someone can help?

Thanks in advance.