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: 

BAPI_OUTB_DELIVERY_CHANGE is not changing quantity

former_member666258
Participant
0 Kudos
324

Hello i'm triying to change my quantity to 0 , i really don't know what it can be try.png

This is my code (i think everything looks great)

DATA: lt_return    TYPE TABLE OF bapiret2,
ls_header TYPE bapiobdlvhdrchg,
ls_headerx TYPE bapiobdlvhdrctrlchg,
ls_control TYPE bapidlvcontrol,
item_data TYPE bapiobdlvitemchg,
item_ctrl TYPE bapiobdlvitemctrlchg,
lt_item_data TYPE TABLE OF bapiobdlvitemchg,
lt_item_ctrl TYPE TABLE OF bapiobdlvitemctrlchg.

ls_header-deliv_numb = delivery_info-vbeln.
ls_headerx-deliv_numb = delivery_info-vbeln.
ls_control-upd_ind = 'U'.

item_data-deliv_numb = delivery_info-vbeln.
item_data-deliv_item = delivery_info-posnr.
item_data-dlv_qty = 0. "delivery_info-lfimg.
item_data-dlv_qty_imunit = 0. "delivery_info-lips_lgmng.
item_data-del_qty_flo = delivery_info-lips_lfimg_flo.
item_data-dlv_qty_st_flo = delivery_info-lips_lgmng_flo.
item_data-fact_unit_nom = delivery_info-lips_umvkz.
item_data-fact_unit_denom = delivery_info-lips_umvkn.
item_data-conv_fact = delivery_info-lips_umrev.

item_ctrl-deliv_numb = delivery_info-vbeln.
item_ctrl-deliv_item = delivery_info-posnr.
item_ctrl-chg_delqty = abap_true.

APPEND item_data TO lt_item_data.
APPEND item_ctrl TO lt_item_ctrl.

CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
EXPORTING
header_data = ls_header
header_control = ls_headerx
delivery = delivery_info-vbeln
techn_control = ls_control
TABLES
item_data = lt_item_data
item_control = lt_item_ctrl
return = lt_return.

IF lt_return[] IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF.
1 REPLY 1

0 Kudos
232

Hi. Have you solved it ?