Hello,
I am using function module SD_DELIVERY_UPDATE_PICKING to pick delivery items. This FM is being called in a loop for each delivery item. Delivery has two items, and each item has to be picked in two batches. This FM call is working fine if there is only one item in delivery. When delivery with two items are processed, 2nd item throws error message as "Item 900003: Only 0 qty from material xxxx are available". But when I check the delivery after the FM call, it shows first item as picked correctly under two batches.
Here I have showed the code I am using to call FM.
Loop at delivery_itab.
wa_vbkok-vbeln_vl = wa_e1edl20-vbeln.
wa_vbkok-wadat_ist = lv_pgidate.
wa_vbpok-vbeln = wa_e1edl20-vbeln.
wa_vbpok-posnn = wa_e1edl24-posnr.
wa_vbpok-vbeln_vl = wa_e1edl20-vbeln.
wa_vbpok-posnr_vl = wa_e1edl24-posnr.
wa_vbpok-charg = wa_e1edl24-charg.
wa_vbpok-matnr = wa_e1edl24-matnr.
wa_vbpok-vbtyp_n = 'J'.
wa_vbpok-taqui = 'X'.
APPEND wa_vbpok TO lt_vbpok.
...For each delivery item...
CALL FUNCTION 'SD_DELIVERY_UPDATE_PICKING'
EXPORTING
vbkok_wa = wa_vbkok
synchron = 'X'
nicht_sperren = 'X'
if_error_messages_send = 'X'
TABLES
vbpok_tab = lt_vbpok
prot = lt_prot.
Endloop.
I also tried function module WS_DELIVERY_UPDATE in the same place of code. That also gives the same issue. I tried WS_DELIVERY_UPDATE as showed below.
CALL FUNCTION 'WS_DELIVERY_UPDATE'
EXPORTING
vbkok_wa = wa_vbkok
synchron = 'X'
commit = 'X'
delivery = wa_vbkok-vbeln_vl
update_picking = 'X'
TABLES
vbpok_tab = lt_vbpok
prot = lt_prot
EXCEPTIONS
error_message = 99.
Also I tried to call the FM with all the delivery items appended in itab lt_vbpok. That doesn't work, gives the same error message. I have also taken care to wait until delivery update is commited. Also I am doing Enque and Deque for the delivery document.
Can you pls suggest me if I am missing any parameters / any thing here ? I would greatly appreciate your help.
Thanks
Hari