# WS_DELIVERY_UPDATE — Update Delivery (Picking, Packing, Goods Issue)

> Updates an existing delivery in one call: picked quantities, packing into handling units and posting goods issue, controlled by VBKOK_WA and VBPOK_TAB. Custom picking, scanning and goods issue programs use it widely, although it is not a released BAPI. Set the goods issue flag in VBKOK_WA when needed, check PROT and the EF_ERROR flags, and use COMMIT or your own commit.

- Modules: SD
- Type: Function module
- Function group: V50L
- Remote-enabled (RFC): Yes
- S/4HANA status: Used the same way in S/4HANA
- URL: https://nekuhub.com/en/functions/ws-delivery-update/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| VBKOK_WA | VBKOK | Delivery header control data (VBKOK) | Yes |
| DELIVERY | LIKP-VBELN | Delivery number | Yes |
| SYNCHRON | RVSEL-XFELD | Synchronous update | - |
| COMMIT | RVSEL-XFELD | Commit work inside the function | - |
| UPDATE_PICKING | RVSEL-XFELD | Update picked quantities | - |
| NICHT_SPERREN | RVSEL-NO_SP | Do not lock the delivery | - |
| NO_MESSAGES_UPDATE | RVSEL-XFELD | Do not update output messages | - |
| IF_DATABASE_UPDATE | LESHP_DATABASE_UPDATE | Database update mode | - |
| IF_ERROR_MESSAGES_SEND_0 | XFELD | Send error messages | - |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| EF_ERROR_ANY_0 | XFELD | Any error occurred |
| EF_ERROR_IN_ITEM_DELETION_0 | XFELD | Error while deleting items |
| EF_ERROR_IN_POD_UPDATE_0 | XFELD | Error in proof of delivery update |
| EF_ERROR_IN_INTERFACE_0 | XFELD | Error in interface data |
| EF_ERROR_IN_GOODS_ISSUE_0 | XFELD | Error in goods issue posting |
| EF_ERROR_IN_FINAL_CHECK_0 | XFELD | Error in final check |
| EF_ERROR_PARTNER_UPDATE | XFELD | Error in partner update |
| EF_ERROR_SERNR_UPDATE | XFELD | Error in serial number update |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| VBPOK_TAB | VBPOK | Delivery item control data (VBPOK) | - |
| PROT | PROTT | Error log | - |
| VERKO_TAB | VERKO | Handling unit headers for packing | - |
| VERPO_TAB | VERPO | Handling unit items for packing | - |
| IT_HANDLING_UNITS | HUM_REHANG_HU | Handling units to assign | - |
| ET_CREATED_HUS | VEKPVB | Handling units created | - |

## Call template (ABAP)

```abap
CALL FUNCTION 'WS_DELIVERY_UPDATE'
  EXPORTING
    vbkok_wa = lv_vbkok_wa
    delivery = lv_delivery
  IMPORTING
    ef_error_any_0 = lv_ef_error_any_0
    ef_error_in_item_deletion_0 = lv_ef_error_in_item_deletion_0
    ef_error_in_pod_update_0 = lv_ef_error_in_pod_update_0
    ef_error_in_interface_0 = lv_ef_error_in_interface_0
    ef_error_in_goods_issue_0 = lv_ef_error_in_goods_issue_0
    ef_error_in_final_check_0 = lv_ef_error_in_final_check_0
    ef_error_partner_update = lv_ef_error_partner_update
    ef_error_sernr_update = lv_ef_error_sernr_update
  TABLES
    vbpok_tab = lt_vbpok_tab
    prot = lt_prot
    verko_tab = lt_verko_tab
    verpo_tab = lt_verpo_tab
    it_handling_units = lt_it_handling_units
    et_created_hus = lt_et_created_hus.
```

## Related tables

LIKP, LIPS, VBFA, VEKP, VEPO

