08-05-2022 11:33 AM
Hi All.
I wanted to change the Batch manually from FM WS_DELIVERY_UPDATE_2 but the FM is not updating the batch in delivery. Could anyone has any idea what need to done for updating CHARG field in Delivery.
08-05-2022 11:48 AM
You can update the batch by using the BADI : LE_SHP_DELIVERY_PROC. And then use the method SAVE_DOCUMENT_PREPARE.
08-05-2022 11:52 AM
Why would you need to use BAdI to update a batch during delivery creation when there is standard functionality of batch determination?
08-05-2022 11:56 AM
The idea is to let the batch be determined automatically as per the customer logic instead of the standard SAP logic.
08-05-2022 12:50 PM
Hi Nitesh.
I can't use BADI as I have to call an BAPi and FM to update BATCh and Pick quantity in my odata service . I wanted to know how we can update Batch from FM WS_DELIVERY_UPDATE_2
08-05-2022 12:58 PM
I found a question that might help you: Update Batch Number and Picking Quantity
I also have used the FM WS_DELIVERY_UPDATE_2 to update picking quantity details in the past but have never used it for updating the batch number. With the information I see from the above link, yes, you should be able to update the batch number as well by using the FM WS_DELIVERY_UPDATE_2.
08-08-2022 8:51 AM
08-05-2022 1:10 PM
Hi Alkma,
Odd requirement to say the least, but you can use this BADI which allows you to pass extra data using the EXTENSION1 & EXTENSION2 tables - 'SMOD_V50B0001'. Oh, and this is related to BAPI_OUTB_DELIVERY_CHANGE, which I would opt for over using the other FMs mentioned.
Regards,
Ryan Crosby
08-05-2022 1:11 PM
08-05-2022 1:22 PM
Hi alkma.khan
Is this batch not updated for some materials only and not updating for all materials.? If you can provide the code, it will help us08-05-2022 3:16 PM
Hi Venkateswarn ,
I am first trying with Standlone Fm WS_DELIVERY_UPDATE_2 to update batch in delivery and pick quantity. BAPI_OUT_DELIVERY_CHANGE will update batch but it don't have pick quantity field so I can't use this BAPI and thought to use FM WS_DELIVERY_UPDATE_2 which has both the field.
08-05-2022 3:18 PM
Hi Ryan,
I am not sure will this will work for fm used in ODATA service . Is this can be used if I wanted to use FM in Odata crud method?
08-05-2022 3:24 PM
Hi Alkma,
I cannot say because I'm not sure what you are using for an OData service.
08-05-2022 3:36 PM
Hi alkma.khan
Try this FM WS_DELIVERY_UPDATE.. ( not WS_DELIVERY_UPDATE_2 ).. For me it was working.
08-08-2022 8:45 AM
Hi Venkateswaran,
Could you please share what all the filled you have set in FM to change batch. I have to change pick quanity and batch both and do PGI.
08-08-2022 9:15 AM
Try this example
LOOP AT it_lips_del INTO wa_lips_del.
CLEAR: wa_item.
wa_item-deliv_numb = l_vbeln.
wa_item-deliv_item = wa_lips_del-posnr.
wa_item-material = wa_lips_del-matnr.
wa_item-batch = wa_lips_del-charg.
wa_item-fact_unit_nom = 1.
wa_item-fact_unit_denom = 1.
APPEND wa_item TO it_item.
CLEAR: wa_item_ctr.
wa_item_ctr-deliv_numb = l_vbeln.
wa_item_ctr-deliv_item = wa_lips_del-posnr.
wa_item_ctr-del_item = 'X'.
APPEND wa_item_ctr TO it_item_ctr.
ENDLOOP.
REFRESH: it_ret2.
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
EXPORTING
header_data = wa_header
header_control = wa_header_ctr
delivery = l_vbeln
TABLES
item_data = it_item
item_control = it_item_ctr
return = it_ret2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
Regards,
Venkat
08-09-2022 8:16 AM
Hi Venkat,
I have to update Pick quanity and batch both that is why I am trying with WS_DELIVERY_UPDATE_2. This Bapi will only change batch there is no field for pick quantity.