title: How to remove batch number on delivery?
body: <p>I need to remove the batch number (<em>LIPS-CHARG</em>) on the delivery item and tried with <strong>BAPI_OUTB_DELIVERY_CHANGE</strong> without success.
  I can change the delivery quantity (<em>LIPS-LFIMG</em>) correctly with this BAPI and change the picking number (<em>LIPS-PKIMG</em>) with <strong>WS_DELIVERY_UPDATE_2</strong>, but can't remove the batch number.</p>
  <p>Does someone already remove the batch number?  Don't need to use this BAPI, can be another one. I just need to remove the batch in any way.</p>
  <p>The following code works to change the delivery quantity and picking quantity. At a certain moment, I change picking quantity to zero and at this moment I need to remove the batch number.</p>
  <pre><code>&quot;&amp;**** Begin structures BAPI_OUTB_DELIVERY_CHANGE *******
  ls_header_data-deliv_numb     = p_vbeln.
  ls_header_control-deliv_numb  = p_vbeln.
    
  APPEND INITIAL LINE TO lt_item_data ASSIGNING FIELD-SYMBOL(&lt;ls_item_data&gt;).
  
  &lt;ls_item_data&gt;-deliv_numb       = p_vbeln.
  &lt;ls_item_data&gt;-deliv_item       = lv_posnn.
  &lt;ls_item_data&gt;-material         = &lt;ls_alv&gt;-matnr. 
  &lt;ls_item_data&gt;-batch            = &lt;ls_alv&gt;-charg. 
  &lt;ls_item_data&gt;-hieraritem       = &lt;ls_lips&gt;-posnr.
  &lt;ls_item_data&gt;-usehieritm       = '1'. 
  &lt;ls_item_data&gt;-dlv_qty          = lv_delivery_qtd. &quot;my delivery quantity
  &lt;ls_item_data&gt;-dlv_qty_imunit   = lv_delivery_qtd. &quot;my delivery quantity
  &lt;ls_item_data&gt;-fact_unit_nom    = &lt;ls_lips&gt;-umvkz.
  &lt;ls_item_data&gt;-fact_unit_denom  = &lt;ls_lips&gt;-umvkn.
  &lt;ls_item_data&gt;-sales_unit       = &lt;ls_lips&gt;-vrkme.
  
  APPEND INITIAL LINE TO lt_item_control ASSIGNING FIELD-SYMBOL(&lt;ls_item_control&gt;).
  
  &lt;ls_item_control&gt;-deliv_numb = p_vbeln.
  &lt;ls_item_control&gt;-deliv_item = lv_posnn.
  &lt;ls_item_control&gt;-chg_delqty = 'X'.
  &quot;&amp;**** End structures BAPI_OUTB_DELIVERY_CHANGE *******
  
  CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
  EXPORTING
    header_data    = ls_header_data
    header_control = ls_header_control
    delivery       = p_vbeln
  TABLES
    item_data      = lt_item_data
    item_control   = lt_item_control
    return         = lt_return.
   
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'. 
  
    
  &quot;&amp;**** Begin structures WS_DELIVERY_UPDATE_2 *******
  APPEND INITIAL LINE TO lt_vbpok ASSIGNING FIELD-SYMBOL(&lt;ls_vbpok&gt;).
  &lt;ls_vbpok&gt;-vbeln_vl = &lt;ls_lips&gt;-vbeln.                
  &lt;ls_vbpok&gt;-posnr_vl = &lt;ls_lips&gt;-posnr.                
  &lt;ls_vbpok&gt;-vbeln    = &lt;ls_lips&gt;-vgbel.                
  &lt;ls_vbpok&gt;-posnn    = &lt;ls_lips&gt;-vgpos.                
  &lt;ls_vbpok&gt;-matnr    = &lt;ls_lips&gt;-matnr.
  &lt;ls_vbpok&gt;-werks    = &lt;ls_lips&gt;-werks.
  &lt;ls_vbpok&gt;-umvkz    = &lt;ls_lips&gt;-umvkz.                
  &lt;ls_vbpok&gt;-umvkn    = &lt;ls_lips&gt;-umvkn.                
  &lt;ls_vbpok&gt;-gewei    = &lt;ls_lips&gt;-gewei.
  &lt;ls_vbpok&gt;-charg    = &lt;ls_alv&gt;-charg.
  &lt;ls_vbpok&gt;-pikmg    = lv_picking_qtd.   &quot;my picking quantity
  
  ls_vbkok-vbeln_vl = &lt;ls_lips&gt;-vbeln.               
  ls_vbkok-vbtyp_vl = 'J'.                           
  ls_vbkok-komue    = 'X'.                           
  ls_vbkok-gewei    = &lt;ls_lips&gt;-gewei.
  ls_vbkok-anzpk    = lv_anzpk.
  ls_vbkok-kzapk    = 'X'.
  &quot;&amp;**** End structures WS_DELIVERY_UPDATE_2 *******
  
  CALL FUNCTION 'WS_DELIVERY_UPDATE_2'
  EXPORTING
      vbkok_wa                  = ls_vbkok
      delivery                  = p_vbeln
      synchron                  = abap_true
      update_picking            = abap_true
      nicht_sperren_1           = abap_true
      commit                    = abap_false
      if_error_messages_send    = abap_false
  IMPORTING
      ef_error_any              = ls_error-any
      ef_error_in_item_deletion = ls_error-in_item_deletion
      ef_error_in_pod_update    = ls_error-in_pod_update
      ef_error_in_interface     = ls_error-in_interface
      ef_error_in_goods_issue   = ls_error-in_goods_issue
      ef_error_in_final_check   = ls_error-in_final_check
      ef_error_partner_update   = ls_error-partner_update
      ef_error_sernr_update     = ls_error-sernr_update
  TABLES
      vbpok_tab                 = lt_vbpok.
      
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
  </code></pre>