DATA ls_header TYPE bapiobdlvhdrchg.
DATA ls_ctrl TYPE bapiobdlvhdrctrlchg.
DATA lv_delivery TYPE vbeln_vl.
DATA lt_item TYPE STANDARD TABLE OF bapiobdlvitemchg.
DATA lt_itemctrl TYPE STANDARD TABLE OF bapiobdlvitemctrlchg.
DATA gt_retn TYPE STANDARD TABLE OF bapiret2.
DATA ls_item TYPE bapiobdlvitemchg.
DATA ls_itemctrl TYPE bapiobdlvitemctrlchg.
DATA ls_retn TYPE bapiret2.
DATA ls_lips TYPE lips.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = '8400012446'
IMPORTING
output = lv_delivery.
"header
ls_header-deliv_numb = lv_delivery.
"header control
ls_ctrl-deliv_numb = lv_delivery.
"items
CLEAR ls_item.
ls_item-deliv_numb = lv_delivery.
ls_item-dlv_qty = '9'.
SELECT SINGLE * FROM lips INTO ls_lips
WHERE vbeln = ls_item-deliv_numb.
IF sy-subrc = 0.
ls_item-fact_unit_nom = ls_lips-umvkz.
ls_item-fact_unit_denom = ls_lips-umvkn.
ls_item-conv_fact = ls_lips-umrev.
ls_item-deliv_item = ls_lips-posnr.
ls_item-sales_unit = ls_lips-vrkme.
ENDIF.
APPEND ls_item TO lt_item.
"item control
ls_itemctrl-deliv_numb = lv_delivery.
ls_itemctrl-deliv_item = ls_item-deliv_item.
ls_itemctrl-chg_delqty = 'X'.
APPEND ls_itemctrl TO lt_itemctrl.
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
EXPORTING
header_data = ls_header
header_control = ls_ctrl
delivery = lv_delivery
TABLES
item_data = lt_item
item_control = lt_itemctrl
return = gt_retn.
READ TABLE gt_retn INTO ls_retn WITH KEY type = 'E'.
IF sy-subrc = 0.
"Error handling
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
BAPI Function Module BAPI_OUTB_DELIVERY_CHANGE is being used to update the delivery Quantity and Pick Quantity, Above code demonstrate the code to do the same.