cancel
Showing results for 
Search instead for 
Did you mean: 

WS_DELIVERY_UPDATE - Set Delivery Status

0 Kudos

Hi,

I am using the FM WS_DELIVERY_UPDATE to update the picking quantity. The picking quantity gets updated correctly, however the Delivery Status (VBUK-KOSTK) does not get updated to 'C'. It still remains as 'B'. I am setting the UPDATE_PICKING parameter as 'X'. But still the Delivery Status is not getting updated.

Can any one provide a solution?

Following is the Code

     ls_vbkok-packing_refresh = 'X'.

     ls_vbkok-vbeln = w_vbeln.

     ls_vbkok-vbeln_vl = w_vbeln.


     ls_vbpok-vbeln_vl = ls_lips-vbeln.

     ls_vbpok-posnr_vl = ls_lips-posnr.    " Delivery Item

     ls_vbpok-vbeln = ls_lips-vgbel.       " Sales order - Ref Doc

     ls_vbpok-posnn = ls_lips-vgpos.       " SO Line item - Ref doc item

     ls_vbpok-matnr = ls_lips-matnr.       " Material No

     ls_vbpok-charg = ls_lips-charg.

     ls_vbpok-werks = ls_lips-werks.       " Plant

     ls_vbpok-pikmg = w_lfimg.

     APPEND ls_vbpok TO li_vbpok.


         ls_hu-top_hu_external = ls_vekp-exidv.

         ls_hu-top_hu_internal = ls_vepo-venum.

         ls_hu-venum = ls_vepo-venum"Handling Unit

         ls_hu-vepos = ls_vepo-vepos"HU Item

         ls_hu-rfbel = w_vbeln"Delivery

         ls_hu-rfpos = ls_lips-posnr.          "Delivery Item

         APPEND ls_hu TO li_hu.

* Call for updating picking and packing process

     CALL FUNCTION 'WS_DELIVERY_UPDATE'

       EXPORTING

         vbkok_wa          = ls_vbkok

         synchron          = 'X'

         delivery          = ls_vbkok-vbeln_vl

         commit            = 'X'

         update_picking    = 'X'

       TABLES

         vbpok_tab         = li_vbpok

         prot              = li_prot

         it_handling_units = li_hu

       EXCEPTIONS

         error_message     = 1

         OTHERS            = 2.


Thanks,

Amit Behera

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

I sorted it out. The quantity was required to be passed in the base unit of measure.

Answers (2)

Answers (2)

0 Kudos

I sorted it out. The quantity was required to be passed in the base unit of measure.

Jelena
Active Contributor
0 Kudos

VBUK is the header level status, it would be updated when all items on the delivery are picked. If you check VBUP table, I bet you'll find that at least one of the items has a status <> C. I see that you're using handling units, maybe it has something to do with that.