10-16-2008 1:46 PM
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
10-16-2008 3:34 PM
Hi ,
Try this way
Step 1
loop at tvblkp.
hvbpok-vbeln_vl = tvblkp-vbeln.
hvbpok-posnr_vl = tvblkp-posnr.
hvbpok-posnn = tvblkp-posnr.
hvbpok-vbeln = vblkk-komau.
hvbpok-vbtyp_n = 'Q'.
hvbpok-pikmg = tvblkp-komng.
hvbpok-meins = tvblkp-meins.
hvbpok-ndifm = 0.
hvbpok-taqui = ' '.
if tvblkp-posnr > '900000' and not tvblkp-uecha is initial.
hvbpok-taqui = 'X'.
endif.
hvbpok-charg = tvblkp-charg.
hvbpok-matnr = tvblkp-matnr.
hvbpok-brgew = tvblkp-brgew.
hvbpok-gewei = tvblkp-gewei.
hvbpok-volum = tvblkp-volum.
hvbpok-voleh = tvblkp-voleh.
hvbpok-orpos = 0.
append hvbpok.
endloop.
*--call FM after the loop.
Step 2 .
sav_nast = nast.
call function 'SD_DELIVERY_UPDATE_PICKING'
exporting
nicht_sperren = 'X'
vbkok_wa = vbkok
aufrufer_t = 'X'
if_error_messages_send = ' '
tables
vbpok_tab = hvbpok
prot = lt_prot.
Regards,
Vind
02-18-2011 11:27 AM
Hi Hari,
The issue with FM - SD_DELIVERY_UPDATE_PICKING - is that it cannot allocate a batch to a delivery line item( I have tried many times and even posted this question waiting for a valid solution, however none have come through) . The error which you see is a standard error which also displays the batch allottment, however as the batch is not assigned - only the material is displayed in the message.
One workaround to this is to manually update the batch in the sales order(via BDC) and then run this function module to PICK (or PGI).
Hope this helps.
Thanks,
Aditya