Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Update Storage Location with WS_DELIVERY_UPDATE_2

Former Member
0 Kudos

Hi, I'm trying to set the Storage Location (LGORT) value for an Outbound Delivery with FM WS_DELIVERY_UPDATE_2 but I simply cannot get it work. I'm being testing the FM using se37.

I'm being able to update data from the header, but not for Items. Any idea of why is this happening?

Thanks.

6 REPLIES 6

Former Member
0 Kudos

check if you are passing the below parameters.

CALL FUNCTION 'WS_DELIVERY_UPDATE_2'

EXPORTING

vbkok_wa = ls_vbkok

no_messages_update_1 = 'X'

commit = 'X'

delivery = p_delivery

if_error_messages_send = ' '

IMPORTING

ef_error_any = lv_error_any

ef_error_in_item_deletion = lv_error_in_item_deletion

ef_error_in_pod_update = lv_error_in_pod_update

ef_error_in_interface = lv_error_in_interface

ef_error_in_goods_issue = lv_error_in_goods_issue

ef_error_in_final_check = lv_error_in_final_check

ef_error_partner_update = lv_error_partner_update

ef_error_sernr_update = lv_error_sernr_update

TABLES

vbpok_tab = p_vbpok

tvpod_tab = p_tvpod.

0 Kudos

Hi,

The function module to create delivery has 3 user exits EXIT_SAPLV50R_CREA_001, 002, 003 in enhancement V50R0003. I was unable to change the batch so used 2nd user-exit. May be ypu find them useful for storage location too.

0 Kudos

Thanks for that. At the end there was a customizing problem. I couldn't change the Storage Location because it wasn't coming from the Sales Order / PO. So at the end, the storage location it is filled automatically when creating Outbound Delivery FROM Sales Order / PO.

Thanks for that,

Pablo

0 Kudos

just thought: EXPORT my_lgort & IMPORT the same in any user exit, where u can change SAP assigned lgort.

thanq

former_member186734
Active Participant

Hi! Did you tried set VBPOK_TAB-KZLGO = 'X'? This works for me!

0 Kudos

i have another example

 lw_item_data-deliv_numb = lw_lips-vbeln.
 lw_item_data-deliv_item = lw_lips-posnr.
 lw_item_data-material = lw_lips-matnr.
 lw_item_data-batch = lw_lips-charg.
 lw_item_data-dlv_qty = lw_lips-lfimg.
 lw_item_data-dlv_qty_imunit = lw_lips-lfimg.
 lw_item_data-hieraritem = lw_lips-posnr.
 lw_item_data-usehieritm = 1.
 lw_item_data-fact_unit_nom = lw_lips-umvkz.
 lw_item_data-fact_unit_denom = lw_lips-umvkn.
 lw_item_data-base_uom = lw_lips-meins.
 lw_item_data-sales_unit = lw_lips-vrkme.
 lw_item_control-deliv_numb = lw_lips-vbeln.
 lw_item_control-deliv_item = lw_lips-posnr.
 lw_item_control-chg_delqty = 'X'.
 lw_item_data_spl-deliv_numb = lw_lips-vbeln.
 lw_item_data_spl-deliv_item = lw_lips-posnr.
 lw_item_data_spl-pick_denial = 'X'.
 lw_item_data_spl-stge_loc = lw_lips-lgort.

 APPEND lw_item_data TO li_item_data .
 APPEND lw_item_control TO li_item_control.
 APPEND lw_item_data_spl TO li_item_data_spl.

 lw_header_data-deliv_numb = pl_orden.
 lw_header_control-deliv_numb = pl_orden.
 lw_header_tech_control-upd_ind = 'U'.


 CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
 EXPORTING
 header_data = lw_header_data
 header_control = lw_header_control
 delivery = pl_orden
 techn_control = lw_header_tech_control
 TABLES
 item_data = li_item_data
 item_control = li_item_control
 return = li_return_change
 item_data_spl = li_item_data_spl.

**Important lw_header_tech_control-upd_ind = 'U'.

original post

https://answers.sap.com/comments/6523897/view.html