Update picking quantity in delivery for batch split items

Hi,
I'm trying to use the function module WS_DELIVERY_UPDATE to update the existing deliveries. I'm able to do batch split for the items in delivery using the same FM. I have also requirement to delete these items (batch split items).
To delete these items first we have to make quantities to zero. So I'm able to make delivery quantity of these items to zero but not picking quantity.
If we do not make picking quantity also zero it will not allow to delete these items
and gives an error message saying "item is already made available for transfer order".
Could some one let me kow how to make picking quantity also zero for batch spit items using FM.
Thanks

Hi Vikram
To nullify the Picking Quantity, we can use FM: <b>SD_DELIVERY_UPDATE_PICKING</b>.
Parameters to be passed:
VBKOK_WA
-- VBELN_VL - Delivery Number
-- VBELN - Sales Document Number
SYNCHRON - 'X'
VBPOK_TAB
-- VBELN_VL - Delivery Number
-- POSNR_VL - Delivery Item Number
-- VBELN -- Sales Document Number
-- POSNN -- Sales Document Item Number
-- MATNR -- Material Number
-- LFIMG -- '0.000'.
Have tried this in both cases whereby we have partial picking done and full picking done and worked for both cases.
Please try on your end too...
Hope this helps.
Regards
Eswar

Similar Messages

  • Update picking quantity in delivery (Batch split items) using function modu

    Hi All,
    I need to update a picking quantity with zero value in delivery for batch split items (Item numbers start with 900001. etc).I'm trying to use WS_DELIVERY_UPDATE
    and SD_DELIVERY_UPDATE_PICKING. I'm passing parameter VBKOK-KOMUE , and all other details, but it is not updating.
    I'm able to update delivery quantity of same item with zero value but not picking quantity.
    Could you please let me know how to achive this.
    Regards
    Vikram

    I think the number 900001is mean batch split line item.
    example:
    In Deivery Note:
    Item 10
         Batch 900001
         Batch 900002
    Item 20
         Batch 900003
         Batch 900004
    That right,

  • Quality certficates for batch split items in delivery

    Hi Masters
       How to make the output determination for outgoing quality certificates to select the output type LQCB
    for batch split items in Delivery.
    What is the routine to be selected in the output determination to map this scenario?
    Regards
    Mohan

    Hi Masters
            My problem is When i create a delivery for the items with batch split, the output type LQCB is not determined ie., not automatically get assigned in the delivery item.Hence the delivery items are not listed while executing T code QC20/
    What am I missing?
    -mohan

  • Update picked quantity and delivery quantity in picking.

    hi,
    i completed delivery with reference of sales order, and also complete pgi useing tc vl02n . i want any standard function module or BAPI for  update the picked quantity and delivery quantity in picking.
    thanks in advance.

    Hi Dhanush,
    Refer to the function module WS_DELIVERY_UPDATE for pick, pack, update serial numbers & PGI functions of the delivery.
    Hope it helps!
    Thanks!
    Preethi.

  • VPRS condition currency for batch split items

    Hi,
    i did the config for billing main item only in my delievry. that is batch split items will not be billed separately in billing.
    before doing the above change, the currency of VPRS was appearing as document currency but after doing the above config, the currency of VPRS is changed to material valuation currency.(i.e taken from material master)
    what is to be done so that currency for vprs in case of billing of main items shud be equal to document currency.
    if there is no batch split, there is no issue of currency. if there is batch split in delivery and i bill only main item, vprs currency gets changed to material master currency.
    regards
    sac

    Normally, it should work for both bath main item and batch split item.
    Please check the batch split items:
    - what's the item category. Is it relevant for picking?
    - what's the plant / sto.loc. in batch splite items? Is it assigned to a WM?
    - What's the value in LIPS-KOMKZ field for the batch split items? (EK00 is valid only when komkz = A).

  • Item condition repeating in Invoice for Batch split items-V  Urgent

    Hi Guys,
    My Sales order has one line item
    One Item condition is there in the pricing procedure, it brings the value as the relevant condition record is existing.
    Batch split is happening in delivery and because of which the order item is splitting into two lines, the main item is showing the quantity as zero, and the batch split item is holding the entire quantity in the delivery document..
    When this delivery is converting into billing, the invoice is showing two lines, and is bringing the condition both for the main item (zero quantity), and for the batch split item (with full quantity).
    Now because of this the customer is being charged twice by way of this condition type which is repeating in both the line items.
    Ideally, for the main item which has the quantity as zero, this condition should not come. It should rather appear for the item which holds the full quantity.
    How can correct this, pls let me know.
    Many Thanks,
    Regards,
    Vivek

    summarize the batch split into the main item: use Billing quantity flag = G in copy control tcode VTFL.
    Roberto

  • EK00 not triggered for batch split items

    Hi experts,
    I have configured output type EK00 for picking List, here's what I've done,
    1)V/38: Verified O/P type EK00.
    2) OVLT: assigned shipping point to o/p type.
    3) VP01SHP: maintained print parameters for shipping point.
    It works fine for non- batch managed materials, but when I have an item with Batch split, the Pick list is not being triggered, can anyone help me identify if I am missing something in the config related to the batch management & picking?
    Thanks in advance for your time.
    Kris T

    Normally, it should work for both bath main item and batch split item.
    Please check the batch split items:
    - what's the item category. Is it relevant for picking?
    - what's the plant / sto.loc. in batch splite items? Is it assigned to a WM?
    - What's the value in LIPS-KOMKZ field for the batch split items? (EK00 is valid only when komkz = A).

  • Delivery order Batch split

    Hi all,
    I am using a smartform to print the Delivery order in VL03n. it is printing fine if there is no batch split.
    The quantity, amount for the delivery items  is  appearing as zero in the print if BATCH SPLIT is there.
      I have 2 items in delivery order like 10 & 20. After batch split, i find one new item 90010 is created under 10 &
    another item  90020 is created  under 20.
      i checked LIPS table where i find all 4 items. But i want to print only 2 main  like 10 & 20 . but the quantity, amount is present
      in batch split items.
      Please suggest how i need to handle batch split in my smartform printing .
    Thanks
    pabi

    Pabhi,
    In LIPS table, you'll find a field UECHA . For batch split item, it will point to parent item and for parent item it will be initial.
    e.g.  For item 90010 it will be  10 & for item 90020 it will be 20. 
    You can loop around the lips table using this relationship and sum the batch split quantities and then transfer that value to parent item. After loop processing you can delete the entries,which have UECHA not initial .

  • No Single batch split item created in delivery during picking

    Hello,
    When there is only one batch split item, SD_DELIVERY_UPDATE_PICKING is not creating batch split item (90001) if delivery quantity is equal or less than picking quantity...I didi search for SAP Note (1360407) and found one which is applicable only to P3A Component.
    Instead of batch split it updates at item level itself. Now if again i post an IDOC with 2 batch split, then it adds both picking quantity and update the same line item itself.
    This is much worse. Any one faced this issue before???
    Thanks to update me
    Regards
    Hari

    When the batch is the same, regardless of the number of times the same batch is picked, the update to the delivery will be to the same header line item. The batch split (delivery line split with parent and child line items) will occur only when there are multiple batches picked against the same header line item. Since this behavior is standard SAP I'm doubtful that this can be changed via an exit or BADI (I couldn't find one to influcence this).

  • There are still batch split items with quantity X for item

    Our current system is ECC6. The deletion of item in the delivery (TO
    confirmed) is different before ECC6 (4.6C). In 4.6, unless quantity of
    batch split items are zeroed out in the delivery, the item cannot be
    deleted. Message "There are still batch split items with quantity X for
    item" is encountered. In ECC, line item can be deleted even batch split
    items are not 0. The message doesn't exist in ECC6.
    Please advise how to activate this message.

    In ECC6, the logic has been completely changed during item deletion.
    Now, there is no way to activate the message VL224 when deleting batch item.
    In 46c,
    FORM XLIPS_LOESCHEN_PRUEFEN is called with XL_ERROR = 'X'.
    Main program     SAPFV50P
    Source code of   FV50PFLP_XLIPS_LOESCHEN_RC
    FORM XLIPS_LOESCHEN_RC
               IF IF_TABIX IS INITIAL.
                 REFRESH LT_REASONS.
                 PERFORM XLIPS_LOESCHEN_PRUEFEN TABLES   LT_REASONS      <<<<<<
                                                USING    LF_POSNR
                                                         CHARX        <<<<<<<
                                                         IF_ALL
                                                CHANGING LF_EXIT.
    In ECC6,
    The FORM is called with XL_ERROR = SPACE. That's why the error is not issued.
    Actually, they are called from different place in ECC and 46c. The logic has  been completely changed.
    Main Program     SAPMV50A
    Source code of   MV50AF0D        
    FORM DELETE_ITEMS_CHECK                                      
               perform xlips_loeschen_pruefen(sapfv50p) tables   ct_reasons   <<<<<
                                                        using    ls_admin-posnr
                                                                 space
                                                                 space   <<<<
                                                                 'GHK' "n_766525
                                                        changing lf_exit.

  • Printing mataerial description for batch split material at delivery level

    Hi all,
    Here i am printing the material description which is maintained in the item level at sales order level.For each material they have maintained two material descripption.I am not able to display the second material description in my export invoice whenever the material is splited into batch ie batch split at delivery level. so please can anyone help me regarding this, I am not able to get it from long time.
    Regards,
    madhu

    Hi,
    You can create a two folders for printing the line items, one folder for the normal line-items and the other folder for printing the BAtch-Split Items. you can do this by putting condition as UEPOS NE 0 or UEPOS EQ 0. You can include the Item-Description of the Batch-Splitted item in the Corresponding folder, so when there will be a batchsplit it will get printed.

  • Constrain delivery quantity "0" in Batch Split item of DN

    Hi all,
      I have been done a "0" constrain on delivery quantity in items of DN which means there will never be "0" delivery quantity in item of DN. But in Batch Split situation , user can still make the delivery quantity "0" in batch split item and save the DN.
      So, can anyone tell me how to constrain the "0" in batch split situation.

    Hi..
    In 0VLP Check configuration related to BOM..
    Test the possibility...
    Reward if u finds this as USEFUL...
    Regds
    MM

  • Inserting Batch Split Items in Delivery

    Hi Folks,
    a very quick question. I was mining for info to get the batchsplit items inserted into an Outbound delivery thru the FM WS_DELIVERY_UPDATE sometime ago. Out of doubt and tight schedule I had to opt for BDC which is not that elegant and I would like to know if anyone of you gurus has managed to insert batch split items for a normal item in a delivery. A sample piece of code would be just what I am looking for, suggestions are invited
    thanks a lot in advance.
    ZAM

    Hi ZAMUser,
    I have played with batch-split Items, this is a little part of the code. In this code I try to update quantity of the delivery. Maybe that will help you
    Regards
    Frédéric
    (comments are in french, and I play with special messages and text)
    *   Livraison
        refresh wlt_btc.
        move : 'SAPMV50A'    to wlt_btc-program ,
               '4004'        to wlt_btc-dynpro ,
               'X'           to wlt_btc-dynbegin.
        append wlt_btc.
        clear  wlt_btc.
        move : 'BDC_OKCODE'  to wlt_btc-fnam ,
               '/00'         to wlt_btc-fval .
        append wlt_btc.
        clear  wlt_btc.
        move : 'LIKP-VBELN'    to wlt_btc-fnam ,
               wlt_badge-vbeln to wlt_btc-fval .
        append wlt_btc.
        clear  wlt_btc.
    *   PoPo.
        move : 'SAPMV50A'    to wlt_btc-program ,
               '1000'        to wlt_btc-dynpro ,
               'X'           to wlt_btc-dynbegin.
        append wlt_btc.
        clear  wlt_btc.
        move : 'BDC_OKCODE'  to wlt_btc-fnam ,
               '=POPO_T'     to wlt_btc-fval .
        append wlt_btc.
        clear  wlt_btc.
    *   Poste.
        if wlt_badge-uecha eq '00000000'.
          move wlt_badge-posnr to wlv_poste.
        else.
          move wlt_badge-uecha to wlv_poste.
        endif.
        move : 'SAPMV50A'    to wlt_btc-program ,
               '0111'        to wlt_btc-dynpro ,
               'X'           to wlt_btc-dynbegin.
        append wlt_btc.
        clear  wlt_btc.
        move : 'BDC_OKCODE'  to wlt_btc-fnam ,
               '=WEIT'       to wlt_btc-fval .
        append wlt_btc.
        clear  wlt_btc.
        move : 'RV50A-POSNR' to wlt_btc-fnam ,
               wlv_poste     to wlt_btc-fval .
        append wlt_btc.
        clear  wlt_btc.
    *   Marque le poste
        move : 'SAPMV50A'    to wlt_btc-program ,
               '1000'        to wlt_btc-dynpro ,
               'X'           to wlt_btc-dynbegin.
        append wlt_btc.
        clear  wlt_btc.
        if wlt_badge-uecha ne '00000000'.
          move : 'BDC_OKCODE'  to wlt_btc-fnam ,
                 '=CHSP_T'     to wlt_btc-fval .
        else.
          move : 'BDC_OKCODE'  to wlt_btc-fnam ,
                 '=IDET_T'     to wlt_btc-fval .
        endif.
        append wlt_btc.
        clear  wlt_btc.
        move : 'BDC_CURSOR'     to wlt_btc-fnam ,
               'LIPS-POSNR(01)' to wlt_btc-fval .
        append wlt_btc.
        clear  wlt_btc.
        if wlt_badge-uecha ne '00000000'.
    *     Recherche le sous poste.
          move : 'SAPMV50A'    to wlt_btc-program ,
                 '3000'        to wlt_btc-dynpro ,
                 'X'           to wlt_btc-dynbegin.
          append wlt_btc.
          clear  wlt_btc.
          move : 'BDC_OKCODE'  to wlt_btc-fnam ,
                 '=POPO_T'     to wlt_btc-fval .
          append wlt_btc.
          clear  wlt_btc.
    *     Sous Poste.
          move : 'SAPMV50A'    to wlt_btc-program ,
                 '0111'        to wlt_btc-dynpro ,
                 'X'           to wlt_btc-dynbegin.
          append wlt_btc.
          clear  wlt_btc.
          move : 'BDC_OKCODE'  to wlt_btc-fnam ,
                 '=WEIT'       to wlt_btc-fval .
          append wlt_btc.
          clear  wlt_btc.
          move : 'RV50A-POSNR'   to wlt_btc-fnam ,
                 wlt_badge-posnr to wlt_btc-fval .
          append wlt_btc.
          clear  wlt_btc.
    *     Marque le sous poste
          move : 'SAPMV50A'    to wlt_btc-program ,
                 '3000'        to wlt_btc-dynpro ,
                 'X'           to wlt_btc-dynbegin.
          append wlt_btc.
          clear  wlt_btc.
          move : 'BDC_OKCODE'  to wlt_btc-fnam ,
                 '=CDET_T'     to wlt_btc-fval .
          append wlt_btc.
          clear  wlt_btc.
          move : 'BDC_CURSOR'     to wlt_btc-fnam ,
                 'LIPS-POSNR(01)' to wlt_btc-fval .
          append wlt_btc.
          clear  wlt_btc.
        endif.
    *   Onglet Qtt
        move : 'SAPMV50A'    to wlt_btc-program ,
               '3000'        to wlt_btc-dynpro ,
               'X'           to wlt_btc-dynbegin.
        append wlt_btc.
        clear  wlt_btc.
        if wlt_badge-uecha ne '00000000'.
          move : 'BDC_OKCODE'  to wlt_btc-fnam ,
                 '=T04'       to wlt_btc-fval .
        else.
          move : 'BDC_OKCODE'  to wlt_btc-fnam ,
                 '=T05'       to wlt_btc-fval .
        endif.
        append wlt_btc.
        clear  wlt_btc.
    *   Mise à jour Qtt livrée
        move : 'SAPMV50A'    to wlt_btc-program ,
               '3000'        to wlt_btc-dynpro ,
               'X'           to wlt_btc-dynbegin.
        append wlt_btc.
        clear  wlt_btc.
        move : 'BDC_OKCODE'  to wlt_btc-fnam ,
               '=SICH_T'     to wlt_btc-fval .
        append wlt_btc.
        clear  wlt_btc.
        move : 'LIPS-LFIMG'  to wlt_btc-fnam ,
               wlv_poids     to wlt_btc-fval .
        append wlt_btc.
        clear  wlt_btc.
    *   Appels du call transaction.
        call transaction 'VL02N'  using wlt_btc
                                  mode  'N'
                                  update 'S'
                                  messages into wlt_error.
        sort wlt_error by msgid msgnr.
    *   Binary search
        read table wlt_error
             with key msgid = 'ZTPL'
                      msgnr = '011'
             binary search.
        if sy-subrc eq space.
          message i011(ztpl) with wlt_error-msgv1 wlt_error-msgv2.
        else.
          read table wlt_error
               with key msgid = 'ZTPL'
                        msgnr = '010'
               binary search.
          if sy-subrc eq space.
            message i010(ztpl) with wlt_error-msgv1 wlt_error-msgv2.
          else.
    *       Pas de binary search pour la recherche d'erreur
            read table wlt_error
                 transporting no fields
                 with key msgtyp = 'E'.
            if sy-subrc eq space.
              message i398(00) with text-e01.
            else.
    *         Mise à jours des masses dans les textes au niveau des postes
    *         de livraison.
              concatenate wlt_lips-vbeln
                          wlt_lips-posnr
                          into wlv_tdname.
    *         Masse net.
              move : 'VBBP'     to wls_thead-tdobject ,
                     wlv_tdname to wls_thead-tdname ,
                     'YP09'     to wls_thead-tdid ,
                     wlv_langu  to wls_thead-tdspras.
              move : wlt_bascule-poids to wls_tdline-tdline ,
                     '*'               to wls_tdline-tdformat .
              refresh wlt_tdline.
              append wls_tdline to wlt_tdline.
              call function 'SAVE_TEXT'
                exporting
                  header                = wls_thead
                  savemode_direct       = 'X'
                tables
                  lines                 = wlt_tdline
                exceptions
                  id                    = 1
                  language              = 2
                  name                  = 3
                  object                = 4
                  others                = 5.
    *         Masse brut.
              move : 'YP07'            to wls_thead-tdid ,
                     wlt_bascule-poid2 to wls_tdline-tdline ,
                     '*'               to wls_tdline-tdformat.
              refresh wlt_tdline.
              append wls_tdline to wlt_tdline.
              call function 'SAVE_TEXT'
                exporting
                  header                = wls_thead
                  savemode_direct       = 'X'
                tables
                  lines                 = wlt_tdline
                exceptions
                  id                    = 1
                  language              = 2
                  name                  = 3
                  object                = 4
                  others                = 5.
    *         Tare.
              move : 'YP08'            to wls_thead-tdid ,
                     wlt_bascule-poid3 to wls_tdline-tdline ,
                     '*'               to wls_tdline-tdformat.
              refresh wlt_tdline.
              append wls_tdline to wlt_tdline.
              call function 'SAVE_TEXT'
                exporting
                  header                = wls_thead
                  savemode_direct       = 'X'
                tables
                  lines                 = wlt_tdline
                exceptions
                  id                    = 1
                  language              = 2
                  name                  = 3
                  object                = 4
                  others                = 5.
            endif.
          endif.
        endif.

  • Update Picking quantity in VL02N?

    Hi All,
    In my application i am Using WS_DELIVERY_UPDATE_2 we can  update picking quantity, it is working fine when we pick full quantity.
    Suppose if i pick partial quantity, for example for one item total qty is 2, i am picking 1 first time and save, next time if i pick 1 second time it is not updating? how can we acieve this??
    Thanks,
    Venkat.

    Use below FM :
    Clear : i_prot.
      refresh : i_prot.
    Delivery Update
      CALL FUNCTION 'LE_MOB_DELIVERY_UPDATE'
           EXPORTING
                do_commit                = 'X'
           TABLES
                t_delivery_items         = i_lips
                prot                     = i_prot
           EXCEPTIONS
                conversion_overflow      = 1
                essential_data_missing   = 2
                error                    = 3
                nothing_to_update        = 4
                lock_after_update_failed = 5
                error_in_delivery_update = 6
                OTHERS                   = 7.
      COMMIT WORK.
    Pass lips-lgort..
    <REMOVED BY MODERATOR>
    Thanks
    Seshu
    Edited by: Alvaro Tejada Galindo on Aug 8, 2008 4:51 PM

  • How to Use BAPI_OUTB_DELIVERY_CHANGE for Batch Split

    Hi Experts, I have the follow delivery:
    Item        Material   Deliv.Qty    Un
    10     739911     2     PQT
    And I want to obtain this:
    Item        Material   Deliv.Qty    Un                            Batch
    10     739911     0     PQT
    900001     739911     1     PQT          ZZ00060
    900002     739911     1     PQT          ZZ00061
    But, after using the Bapi I obtained this:
    Item        Material   Deliv.Qty    Un                            Batch
    10     739911     1,372     PQT
    900001     739911     0,314     PQT          ZZ00060
    900002     739911     0,314     PQT          ZZ00061
    So as you can see the problem is with the "Deliv.Qty". I expected:
    Item        Deliv.Qty
    10            0
    900001     1     
    900002     1     
    But I obtained:
    Item        Deliv.Qty
    10     1,372
    900001     0,314
    900002     0,314
    The parameters that I am using in the Bapi are:
    HEADER_DATA                                   
    DELIV_NUMB = 801174646
    HEADER_CONTROL                                
    DELIV_NUMB = 801174646
    DELIVERY = 801174646
    TECHN_CONTROL
    UPD_IND = U
    ITEM_DATA (three records):   
    DELIV_NUMB = 801174646
    DELIV_ITEM = 000010  
    MATERIAL = 739911  
    FACT_UNIT_NOM = 1   
    FACT_UNIT_DENOM = 1   
    DELIV_NUMB = 801174646  
    DELIV_ITEM = 900001     
    MATERIAL = 739911     
    BATCH = ZZ00060    
    HIERARITEM = 000010     
    USEHIERITM = 1          
    DLV_QTY = 1
    DLV_QTY_IMUNIT = 1
    FACT_UNIT_NOM = 1      
    FACT_UNIT_DENOM = 1      
    DELIV_NUMB = 801174646  
    DELIV_ITEM = 900002     
    MATERIAL = 739911     
    BATCH = ZZ00061    
    HIERARITEM = 000010     
    USEHIERITM = 1          
    DLV_QTY = 1
    DLV_QTY_IMUNIT = 1
    FACT_UNIT_NOM = 1      
    FACT_UNIT_DENOM = 1
    ITEM_CONTROL (three records):
    DELIV_NUMB = 801174646
    DELIV_ITEM = 000010  
    CHG_DELQTY = X
    DELIV_NUMB = 801174646
    DELIV_ITEM = 900001  
    CHG_DELQTY = X
    DELIV_NUMB = 801174646
    DELIV_ITEM = 900002  
    CHG_DELQTY = X
    So I am missing something but I don't know what.
    Can any one help me with this please?
    PD: I have looked the following forums in order to use the Bapi:
    How to Use BAPI_OUTB_DELIVERY_CHANGE for Batch Split
    batch split using BAPI_OUTB_DELIVERY_CHANGE
    Re: Help in BAPI_OUTB_DELIVERY_CHANGE(batch-split)
    BAPI_OUTB_DELIVERY_CHANGE - Batch Splits don't work
    Help for BAPI_OUTB_DELIVERY_CHANGE

    Hey,
    My code is for the inbound delivery but it should work the same.
    Give this a try.
    REPORT  z_delivery_batch_split.
    DATA:header_data  LIKE  bapiibdlvhdrchg,
    header_control  LIKE  bapiibdlvhdrctrlchg,
    delivery  LIKE  bapiibdlvhdrchg-deliv_numb,
    ls_return LIKE bapiret2,
    item_data  TYPE TABLE OF  bapiibdlvitemchg,
    item_control  TYPE TABLE OF bapiibdlvitemctrlchg,
    ls_item_data  LIKE  bapiibdlvitemchg,
    ls_item_control LIKE  bapiibdlvitemctrlchg,
    return TYPE TABLE OF bapiret2 WITH NON-UNIQUE KEY type.
    header_data-deliv_numb = '1800005005'.
    header_control-deliv_numb = '1800005005'.
    delivery = '1800005005'.
    ls_item_data-deliv_numb = '1800005005'.
    ls_item_data-deliv_item = '900001'.
    ls_item_data-material = '000000000020067722'.
    PERFORM create_batch CHANGING ls_item_data-batch.
    ls_item_data-hieraritem = '000010'.
    ls_item_data-usehieritm = '1'.
    ls_item_data-dlv_qty = 80.
    ls_item_data-dlv_qty_imunit = 80.
    ls_item_data-fact_unit_nom = '1'.
    ls_item_data-fact_unit_denom = '1'.
    ls_item_data-sales_unit = 'EA'.
    ls_item_data-base_uom = 'EA'.
    APPEND ls_item_data TO item_data.
    ls_item_data-deliv_numb = '1800005005'.
    ls_item_data-deliv_item = '900002'.
    ls_item_data-material = '000000000020067722'.
    PERFORM create_batch CHANGING ls_item_data-batch.
    ls_item_data-hieraritem = '000010'.
    ls_item_data-usehieritm = '1'.
    ls_item_data-dlv_qty = 60.
    ls_item_data-dlv_qty_imunit = 60.
    ls_item_data-fact_unit_nom = '1'.
    ls_item_data-fact_unit_denom = '1'.
    ls_item_data-sales_unit = 'EA'.
    ls_item_data-base_uom = 'EA'.
    APPEND ls_item_data TO item_data.
    ls_item_control-deliv_numb = '1800005005'.
    ls_item_control-deliv_item = '900001'.
    ls_item_control-chg_delqty = 'X'.
    APPEND ls_item_control TO item_control.
    ls_item_control-deliv_numb = '1800005005'.
    ls_item_control-deliv_item = '900002'.
    ls_item_control-chg_delqty = 'X'.
    APPEND ls_item_control TO item_control.
    break cgavin.
    CALL FUNCTION 'BAPI_INB_DELIVERY_CHANGE'
       EXPORTING
         header_data          = header_data
         header_control       = header_control
         delivery             = delivery
    *   TECHN_CONTROL        = TECHN_CONTROL
       TABLES
    *   HEADER_PARTNER       = HEADER_PARTNER
    *   HEADER_PARTNER_ADDR  = HEADER_PARTNER_ADDR
    *   HEADER_DEADLINES     = HEADER_DEADLINES
         item_data            = item_data
         item_control         = item_control
    *   ITEM_SERIAL_NO       = ITEM_SERIAL_NO
    *   EXTENSION1           = EXTENSION1
    *   EXTENSION2           = EXTENSION2
         return               = return
    *   TOKENREFERENCE       = TOKENREFERENCE
    *   HANDLING_UNIT_HEADER = HANDLING_UNIT_HEADER
    *   HANDLING_UNIT_ITEM   = HANDLING_UNIT_ITEM
    *   PARTIAL_GR_OBJECTS   =          PARTIAL_GR_OBJECTS
    READ TABLE return
    INTO ls_return
    WITH TABLE KEY type = 'E'.
    IF sy-subrc = 0.
       MESSAGE ID ls_return-id TYPE ls_return-type NUMBER ls_return-number WITH ls_return-message_v1 ls_return-message_v2
       ls_return-message_v3 ls_return-message_v4.
    ENDIF.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        wait          = 'X'.
    break cgavin.
    *&      Form  CREATE_BATCH
    *       text
    *      <--P_LS_ITEM_DATA_BATCH  text
    FORM create_batch  CHANGING p_ls_item_data_batch.
       DATA: ls_bncom TYPE bncom.
       ls_bncom-matnr = ls_item_data-material.
       ls_bncom-werks = 'C333'.
       ls_bncom-lgort = '3000'.
       SELECT SINGLE mtart
         FROM mara
         INTO ls_bncom-mtart
         WHERE matnr = ls_bncom-matnr.
       CALL FUNCTION 'VB_NEXT_BATCH_NUMBER'
         EXPORTING
           matnr                          = ls_bncom-matnr
           werks                          = ls_bncom-werks
           check_batch                    = 'X'
           check_material                 = ''
           message_when_auto              = ' '
           x_bncom                        = ls_bncom
           lock_batch                     = ' '
         IMPORTING
           new_charg                      = p_ls_item_data_batch
         EXCEPTIONS
           no_material                    = 1
           no_plant                       = 2
           material_not_found             = 3
           plant_not_found                = 4
           no_batch_handling              = 5
           batch_exist                    = 6
           no_number                      = 7
           illegal_batch_number           = 8
           interval_not_found             = 9
           object_not_found               = 10
           interval_overflow              = 11
           error_automatic_batch_number   = 12
           cancelled                      = 13
           automatic_batch_num_not_active = 14
           OTHERS                         = 15.
       IF sy-subrc = 0.
         CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
           EXPORTING
             wait = 'X'.
       ENDIF.
    ENDFORM.                    " CREATE_BATCH

Maybe you are looking for