Tips about WS_DELIVERY_UPDATE_2

Function Module ‘WS_DELIVERY_UPDATE_2’ can be used to make changes in Deliveries. Here are just a few examples for reference purposes.

1. Update specific field for delivery

Take update the bill of lading as an example. (Check the parameter NICHT_SPERREN_1 which is Flag: Do not block delivery. Passing a ‘Y’ to this parameter prevents locking of the preceding document within the function module.)

 DATA: ls_vbkok_wa TYPE vbkok. DATA: lv_ef_error_any TYPE xfeld. DATA: lt_prot TYPE STANDARD TABLE OF prott, ls_prot LIKE LINE OF lt_prot. " update bill of lading ls_vbkok_wa-vbeln_vl = gs_likp-vbeln . ls_vbkok_wa-bolnr = gs_excel-bolnr. CALL FUNCTION 'WS_DELIVERY_UPDATE_2' EXPORTING vbkok_wa = ls_vbkok_wa commit = 'X' delivery = gs_likp-vbeln
* prevents locking of the preceeding document NICHT_SPERREN_1 = 'Y' if_error_messages_send = ' ' IMPORTING ef_error_any = lv_ef_error_any TABLES prot = lt_prot.

2. Perform the PGI for delivery

 DATA: lt_partner TYPE shp_partner_update_t, ls_partner TYPE shp_partner_update. * populate fields for ls_partner APPEND ls_partner TO lt_partner. CALL FUNCTION 'WS_DELIVERY_UPDATE_2' EXPORTING vbkok_wa = lv_vbkok delivery = lv_vbeln it_partner_update = lt_partner commit = 'X' synchron = 'X' if_no_mes_upd_pack = upd_pack IMPORTING ef_error_any = ef_error_any TABLES prot = lt_prot EXCEPTIONS error_message = 0.

3. Few more examples