Regarding "BAPI_OUTB_DELIVERY_CHANGE"

Have anybody worked on this BAPI, if so please let me know how to populate the custom fields using extn1 & extn2 input parameters... also i found one function exit
"EXIT_SAPLV50I_010" which is called inthis BAPI only to update the custome field. so please let me know whether we have to write code in the include of the function exit... plz reply..

Hi,
  Try to use the FM 'WS_DELIVERY_UPDATE'.
Rgds,
Bujji

Similar Messages

  • Regarding the bapi BAPI_OUTB_DELIVERY_CHANGE

    Hi all,
    Iam using the bapi 'BAPI_OUTB_DELIVERY_CHANGE' to change the deliveries..However i need to update three header fields which are not avaialble in the bapi.so i have added those three fields to the extension structure ..Now i have to update them to the database table....I found one badi 'SMOD_V50B0001' but this is not triggered which we use the FM..so unable to upload the data..can anyone suggest how to update the above three header fields.
    Regards,
    raj

    Hi,
      Try to use the FM 'WS_DELIVERY_UPDATE'.
    Rgds,
    Bujji

  • Regarding bapi to issue PGI BAPI_OUTB_DELIVERY_CHANGE,sample code please

    Can you send me the sample code of this bapiBAPI_OUTB_DELIVERY_CHANGE ,if any one have used this.it's urgent please..

    Hi,
    BAPI_OUTB_DELIVERY_CHANGE - BAPI for Change to Outbound Delivery
    BAPI_INB_DELIVERY_SAVEREPLICA - Create Inbound Delivery
    RV_DELIVERY_CREATE - Create Delivery
    GN_DELIVERY_CREATE - Create an Outbound Delivery
    Код:
    FORM xkomdlgn_fill USING p_open_qty LIKE ekpo-menge
                                           p_eindt LIKE eket-eindt
                                           p_licha LIKE eket-licha
                                           p_charg LIKE eket-charg
                                           p_uzeit LIKE eket-uzeit.
      STATICS: h_grkor LIKE lips-grkor,
      h_bsmng LIKE ekpo-menge.
      CLEAR t_xkomdlgn.
      CHECK t_ekpo-uptyp NE '5' " Lot
      AND t_ekpo-uptyp NE '6' " Display
      AND t_ekpo-uptyp NE '7' " VK-Set
      AND t_ekpo-uptyp NE 'H'. " GT-Stuckliste
      IF t_ekpo-uebpo IS INITIAL AND t_ekpo-upvor CA '1I'.
        CHECK 1 = 2.
      ENDIF.
      IF NOT ekko-lifnr IS INITIAL.
        CALL FUNCTION 'VENDOR_MASTER_DATA_SELECT_12'
          EXPORTING
            pi_lifnr       = ekko-lifnr
            pi_ekorg       = ekko-ekorg
          IMPORTING
            pe_lfm1        = lfm1
          EXCEPTIONS
            no_entry_found = 1
            OTHERS         = 2.
        t_xkomdlgn-vsbed = lfm1-vsbed.
      ELSE.
        CLEAR t_xkomdlgn-vsbed.
      ENDIF.
      t_xkomdlgn-adrnr_li = ekko-adrnr.
      t_xkomdlgn-lifnr = ekko-lifnr.
      t_xkomdlgn-inco1 = ekko-inco1.
      t_xkomdlgn-inco2 = ekko-inco2.
      t_xkomdlgn-exnum = ekko-exnum.
      t_xkomdlgn-bukrs_best = ekko-bukrs.
      t_xkomdlgn-matnr = t_ekpo-matnr.
      t_xkomdlgn-werks = t_ekpo-werks.
    *IF STORAGE LOCATION IS MISSING APPEND
    *FG01 As storage location
      IF t_ekpo-lgort IS INITIAL .
        t_xkomdlgn-lgort = 'FG01' .
      ELSE .
        t_xkomdlgn-lgort = t_ekpo-lgort.
      ENDIF.
      xkomdlgn-charg = ?
      T_XKOMDLGN-VRKME = T_EKPO-MEINS.
      t_xkomdlgn-meins = t_ekpo-lmein.
      t_xkomdlgn-umvkz = t_ekpo-umrez.
      t_xkomdlgn-umvkn = t_ekpo-umren.
      IF t_ekpo-matnr EQ space.
        t_xkomdlgn-meins = t_ekpo-meins.
        t_xkomdlgn-umvkz = 1.
        t_xkomdlgn-umvkn = 1.
      ENDIF.
      t_xkomdlgn-insmk = t_ekpo-insmk.
      t_xkomdlgn-kzfme = t_ekpo-kzfme.
      t_xkomdlgn-kzvbr = t_ekpo-kzvbr.
      t_xkomdlgn-lfimg = p_open_qty.
      t_xkomdlgn-lfdat = p_eindt.
      t_xkomdlgn-lfuhr = p_uzeit.
      xkomdlgn-vstel = ?
      XKOMDLGN-VKORG = ?
      xkomdlgn-vtweg = ?
      XKOMDLGN-SPART = ?
      t_xkomdlgn-traid = t_ekpo-traid."CARRIER CODE
      t_xkomdlgn-lifex = t_ekpo-lifex."External ID
      t_xkomdlgn-bolnr = t_ekpo-bolnr."Bill Of Lading
      t_xkomdlgn-xabln = t_ekpo-xabln."Goods Receipt/Issue Slip Number
      t_xkomdlgn-vgbel = t_ekpo-ebeln.
      t_xkomdlgn-vgpos = t_ekpo-ebelp.
      t_xkomdlgn-lfart = gf_dlv_type.
      t_xkomdlgn-vgtyp = 'V'.
      t_xkomdlgn-kzazu = 'X'.
      t_xkomdlgn-knttp = t_ekpo-knttp.
      t_xkomdlgn-sobkz = t_ekpo-sobkz.
      SELECT * FROM t163g WHERE bstae EQ t_ekpo-bstae
      AND ebtyp EQ gf_ebtyp.
        EXIT.
      ENDSELECT.
      IF sy-subrc = 0.
        prufen, ob lieferavis we-zuordnung hat (vorauss. fur we uber vl32)
        und wepos prufen
        if t163g-wezuo eq space or t_ekpo-wepos eq space.
        t_xkomdlgn-nowab = 'X'.
      ELSE.
        CLEAR t_xkomdlgn-nowab.
      ENDIF.
    ENDIF.
    IF t_ekpo-matnr IS INITIAL OR t_ekpo-pstyp = '6'.
      t_xkomdlgn-posar = 'B'.
    ENDIF.
    t_xkomdlgn-ematn = t_ekpo-ematn.
    t_xkomdlgn-mfrnr = t_ekpo-mfrnr.
    t_xkomdlgn-mfrpn = t_ekpo-mfrpn.
    t_xkomdlgn-emnfr = t_ekpo-emnfr.
    t_xkomdlgn-cuobj = t_ekpo-cuobj.
    t_xkomdlgn-uebto = t_ekpo-uebto.
    t_xkomdlgn-untto = t_ekpo-untto.
    t_xkomdlgn-uebtk = t_ekpo-uebtk.
    t_xkomdlgn-lichn = p_licha.
    t_xkomdlgn-charg = p_charg.
    t_xkomdlgn-bwtar = t_ekpo-bwtar.
    t_xkomdlgn-kdmat = t_ekpo-idnlf.
    t_xkomdlgn-arktx = t_ekpo-txz01.
    t_xkomdlgn-mfrgr = t_ekpo-mfrgr.
    t_xkomdlgn-gewei = t_ekpo-gewei.
    t_xkomdlgn-voleh = t_ekpo-voleh.
    t_xkomdlgn-ntgew = t_ekpo-ntgew * t_xkomdlgn-lfimg.
    t_xkomdlgn-brgew = t_ekpo-brgew * t_xkomdlgn-lfimg.
    t_xkomdlgn-volum = t_ekpo-volum * t_xkomdlgn-lfimg.
    t_xkomdlgn-ean11 = t_ekpo-ean11.
    t_xkomdlgn-podrel = t163l-podrel.
    t_xkomdlgn-aktnr = t_ekpo-aktnr.
    t_xkomdlgn-abeln = t_ekpo-abeln.
    t_xkomdlgn-abelp = t_ekpo-abelp.
    xkomdlgn-ltssf = only SORT criteria IN vl31n
    T_XKOMDLGN-AUREL = T_EKPO-AUREL.
    t_xkomdlgn-idnlf = t_ekpo-idnlf.
    t_xkomdlgn-matkl = t_ekpo-matkl.
    leergut-stuckliste ubernehmen
    clear t_xkomdlgn-grkor.
    CLEAR t_xkomdlgn-kmpmg.
    CLEAR t_xkomdlgn-uepos.
    CLEAR t_xkomdlgn-uepvw.                                     "549736
    IF t_ekpo-upvor CA '3X'.
      h_grkor = h_grkor + 1.
      t_xkomdlgn-grkor = h_grkor.
      h_bsmng = t_ekpo-menge.
    ENDIF.
    IF NOT t_ekpo-uebpo IS INITIAL AND
    t_ekpo-uptyp CA '3X'.
      t_xkomdlgn-uepvw = 'G'.                                   "549736
      t_xkomdlgn-uepos = t_ekpo-uebpo.
      t_xkomdlgn-grkor = h_grkor.
      IF h_bsmng NE 0.
        t_xkomdlgn-kmpmg = t_ekpo-menge / h_bsmng.
      ENDIF.
    ENDIF.
    IF t_ekpo-pstyp EQ '2'.
      t_xkomdlgn-sobkz = 'K'.
    ENDIF.
    kontierungsfelder
    if t_ekpo-sobkz eq 'E' or t_ekpo-sobkz eq 'Q'.
    CALL FUNCTION 'MMPUR_EKKN_READ_EBELN_EBELP'
      EXPORTING
        pi_ebeln             = t_ekpo-ebeln
        pi_ebelp             = t_ekpo-ebelp
        pi_bypassing_buffer  = pi_refresh_buffer
        =
      tables
        pto_ekkn_po          = xekkn
      EXCEPTIONS
        no_records_requested = 1
        OTHERS               = 2.
    IF sy-subrc EQ 0.
      READ TABLE xekkn INDEX 1.
      t_xkomdlgn-ps_psp_pnr = xekkn-ps_psp_pnr.
      t_xkomdlgn-vbelv = xekkn-vbeln.
      t_xkomdlgn-posnv = xekkn-vbelp.
    ENDIF.
    ENDIF.
    APPEND t_xkomdlgn.
    ENDFORM. "xkomdlgn_fill
    LOOP AT t_xkomdlgn.
    set default parameter
    t_xkomdlgn-vgtyp = 'V'.
    t_xkomdlgn-kzazu = 'X'.
    IF t_xkomdlgn-lfart IS INITIAL.
    t_xkomdlgn-lfart = 'EL'.
    ENDIF.
    MODIFY t_xkomdlgn.
    ENDLOOP.
    SELECT SINGLE * FROM tvsa WHERE smart = xvbsk-smart.
    IF sy-subrc 0.
    Error Handling To be Done
    Meldung ins Protokoll
    ENDIF.
    l_nrnr = tvsa-numki.
    CALL FUNCTION 'NUMBER_GET_NEXT'
    EXPORTING
    nr_range_nr = l_nrnr
    object      = 'RV_SAMMG'
    IMPORTING
    number      = xvbsk-sammg
    EXCEPTIONS
    OTHERS      = 1.
    IF sy-subrc 0.
    error hadling tbd
    meldung ins protokoll
    endif.
    CALL FUNCTION 'GN_DELIVERY_CREATE'
    EXPORTING
    no_commit = 'X'
    vbsk_i = xvbsk
    if_no_deque = 'X'
    IF_MASS_READ_MAT_SW = 'X'
    vbls_pos_rueck = 'X'
    TABLES
    xkomdlgn = t_xkomdlgn
    xvbfs = xvbfs
    xvbls = xvbls
    xxlips = xlips.
    get informatioin from ekpo table and fill T_xkomdlgn

  • Regarding using of EXTENSION1 and EXTENSION2 in BAPI_OUTB_DELIVERY_CHANGE

    Hi,
    Can any one please help me how to code for zfields in EXTENSION1 and EXTENSION2 in BAPI_OUTB_DELIVERY_CHANGE
    Thanks,
    Nethaji.

    I had a requirement to change a Z field in LIKP by a BAPI call and found this thread.
    Although the original participant probably have found alternative ways, I hope this can be helpful for others search for a solution to this.
    These are my findings u2013 please correct me if I am wrong. The EXTENSION1 & EXTENSION2 can NOT be used to change LIKP Z-fields. These doesnu2019t do anything in themselves, but can be imported in BADI IF_EX_SMOD_V50B0001~EXIT_SAPLV50I_010 (Thereu2019s a corresponding CMOD in older versions).
    However, the data available here are :
    CS_VBKOK
    CT_VBPOK
    CT_VBSUPCON
    EXTENSION1
    EXTENSION2
    So, for changes to delivery header, only fields in structure CS_VBKOK can be changed. As VBKOK does not have any customer appends, this is not possible. Furthermore is the BAPI BAPI_OUTB_DELIVERY_CHANGE only calling WS_DELIVERY_UPDATE anyway, so the BAPI can not do any magic the FM canu2019t. So what is the purpose with  EXTENSION1/ EXTENSION2 ?
    As I see it, itu2019s a handy way to transfer data to the BADI, so you can build logic to manipulate any of the existing CS_VBKOK fields. You could have done the same with a Memory export/import anyway.
    /END-BAD-NEWS
    /BEGIN-GOOD-NEWS
    After some trial and error, I managed to use BAPI_OUTB_DELIVERY_CHANGE to change Z fields in LIKP. Before the call, I export the desired content to a memory ID, which I then import in MV50AFZ1, BAPI_OUTB_DELIVERY_CHANGE
    See this working demonstration code :
    Calling program :
    *& Report  ZTEST_BAPI_DELIVERY_CHANGE
    report  ztest_bapi_delivery_change.
    data : gs_bapiobdlvhdrchg        type bapiobdlvhdrchg.
    data : gs_bapiobdlvhdrctrlchg    type bapiobdlvhdrctrlchg.
    data : gs_bapidlvcontrol         type bapidlvcontrol.
    data : gt_bapireturn type standard table of  bapiret2.
    data : gs_bapireturn type  bapiret2.
    data : gs_likp type likpvb.
    data : ld_zzhuload   type erlkz.
    constants: gc_x(1)     type c value 'X'.
    parameter : p_vbeln like likp-vbeln.
    Get relevant LIKP fields
    select * from likp
    into corresponding fields of gs_likp
    where vbeln = p_vbeln.
    endselect.
      Fill header data - convert to BAPI format
    call function 'MAP2E_LIKPVB_TO_BAPIOBDLVHDRCH'
      exporting
        likpvb          = gs_likp
      changing
        bapiobdlvhdrchg = gs_bapiobdlvhdrchg.
    Field to set as LIKP Z-field
    ld_zzhuload = 'X'.
    Memory-ID imported in MV50AFZ1
    export ld_zzhuload to memory id 'ZZHULOAD'.
    call function 'BAPI_OUTB_DELIVERY_CHANGE'
      exporting
        header_data           = gs_bapiobdlvhdrchg
        header_control        = gs_bapiobdlvhdrctrlchg
        delivery              = gs_bapiobdlvhdrchg-deliv_numb
        techn_control         = gs_bapidlvcontrol
      tables
        return                = gt_bapireturn
      exceptions
        communication_failure = 1
        system_failure        = 2
        others                = 3.
    if gt_bapireturn[] is initial.
      call function 'BAPI_TRANSACTION_COMMIT'
        exporting
          wait = gc_x.
    else.
      loop at gt_bapireturn into gs_bapireturn
        where type = 'E'.
        message id gs_bapireturn-id type 'S'
        number gs_bapireturn-number with
        gs_bapireturn-message_v1
        gs_bapireturn-message_v2
        gs_bapireturn-message_v3
        gs_bapireturn-message_v4.
        exit.
      endloop.
    endif.
    MV50AFZ1, form USEREXIT_SAVE_DOCUMENT_PREPARE
    data : ld_zzhuload   type erlkz.
    if xlikp-vbtyp = 'J' " outbound delivery
    and  t180-trtyp = 'V'. " Change
    Memory-ID exported from program ZZZ...
    import ld_zzhuload from MEMORY ID 'ZZHULOAD'.
      if sy-subrc is initial
      and not ld _zzhuload is initial.
        LOOP AT xlikp.
          xlikp-zzhuload = ld_zzhuload.
          MODIFY xlikp transporting zzhuload.
        ENDLOOP.
        free MEMORY ID 'ZZHULOAD'.
      endif.
    endif.
    I hope someone will find this helpful. Obviously I can not take responsibility for the functionality
    Sorry for the format, I can not get the tags to work.....

  • Problem when updating delivery quantity using 'BAPI_OUTB_DELIVERY_CHANGE'

    Hi experts,
    I have a requirement in which i need to update the material's delivery quantity in VL03N transaction.   For this im trying the BAPI
    'BAPI_OUTB_DELIVERY_CHANGE' and im passing the following values.
    HEADER_DATA : Delivery no.
    DELIVER : Delivery no.
    ITEM_DATA : Delivery no,
    item no,
    DLV_QTY quantity(changed),
    FACT_UNIT_NOM ( default to value '1')
    FACT_UNIT_DENOM ( default to value '1')
    ITEM_CONTROL : Delivey no,
    item no,
    CHG_DELQTY ( value "X")
    Then i use 'BAPI_TRANSACTION_COMMIT' for updating the changes. 
    Here the problem is, the BAPI is working fine for some quantity , say if i enter the DLV_QTY as 2 in ITEM_DATA, it is gettting updated.  But if i pass some other quantity , say 12, it is returning the folowing error.
    T ID                   NUM MESSAGE
    E VL                   363
    Pls tell why this error comes. and how to successfully update the delivery quantity for a set of material?
    Regards,
    Shanthi

    not answered

  • Not able to delete line items using BAPI_OUTB_DELIVERY_CHANGE

    Hi,
        Not able to delete line items of a delivery using BAPI 'BAPI_OUTB_DELIVERY_CHANGE', with thte below code and even return parameter has zero messages.
    I have even checked existing below posting.
    https://www.sdn.sap.com/irj/scn/logon?redirect=http%3a%2f%2fforums.sdn.sap.com%2fthread.jspa%3fthreadid%3d782509
    Below is the code that i am using.........
    *wa1-deliv_numb = wa_lips-vbeln.
    wa1-deliv_item = wa_lips-posnr.
    APPEND wa1 to item_data.
    wa-deliv_numb = vbeln_so .
    wa-deliv_item = l_item.
    wa-del_item = 'X'.
    APPEND wa TO item_control.
    w_header_data-deliv_numb = vbeln_so .
    w_header_control-deliv_numb = vbeln_so .
    w_delivery = vbeln_so .
    *w_header_control-dlv_del = 'X'. "Delete whole Delivery
    CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
      EXPORTING
        header_data    = w_header_data
        header_control = w_header_control
        delivery       = w_delivery
      TABLES
       item_data      = item_data
        item_control   = item_control
        return         = return.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = 'X'.
    I have even  tried uncommenting item_data parameter but not able to delete line item.....i am able to delete whole delivery but not line items .........can any one of u help me in resolving this issiue plz ???
    Regards,
    M, Manohar

    Kindly use WS_DELIVERY_UPDATE to delete the items
    Sample code:
    L_VBKOK-VBELN_VL = vbeln_so.
    clear l_vbpok.
             refresh l_vbpok.
             l_vbpok-vbeln_vl = vbeln_so
             l_vbpok-posnr_vl = wa_deliv_item.
             l_vbpok-lips_del = c_x.
             append l_vbpok.
             set update task local.
             call function 'WS_DELIVERY_UPDATE'
               exporting
                 vbkok_wa = l_vbkok
                 commit   = ' '
                 delivery = lv_delivery
               tables
                 vbpok_tab = l_vbpok
               exceptions
                 others   = 0.
             commit work and wait.

  • Extension2 to be used in BAPI_OUTB_DELIVERY_CHANGE

    Hi,
    I am using the bAPI BAPI_OUTB_DELIVERY_CHANGE to update two zfields in table LIPS but am unable to update the same using the extension table. I have searched for this post but did not get a satisfying answer for the same.
    I found that the BADI SMOD_V50B0001 needs to be implemented which will then update the structure. Also i have tried using the exit wherein the header table LIKP gets updated but the LIPS table does not. my code for your reference is as below.
    read table extension2 with key param = 'LIKP'
                                     row = 1
                                     field = 'LIFEX'.
      if sy-subrc = 0.
        cs_vbkok-lifex = extension2-value.
      endif.
    endif.
    Update the LIPS table through theVBPOK structure
    DATA: ls_extension1 TYPE bapiextc,
            ls_extension2 TYPE bapiext,
            ls_vbpok      TYPE vbpok,
            lv_tabix TYPE sy-tabix..
      IF extension2[] IS NOT INITIAL.
        LOOP AT ct_vbpok INTO ls_vbpok.
          READ TABLE extension2 INTO ls_extension2
                            WITH KEY param = 'LIPS'
                                       row = ls_vbpok-posnr_vl
                                     field = 'ZECCN'.
          IF sy-subrc = 0.
            ls_vbpok-zeccn = ls_extension2-value.
            MODIFY ct_vbpok FROM ls_vbpok TRANSPORTING zeccn.
          ENDIF.
          READ TABLE extension2 INTO ls_extension2
                           WITH KEY param = 'LIPS'
                                      row = ls_vbpok-posnr_vl
                                    field = 'ZLINSYM'.
          IF sy-subrc = 0.
            ls_vbpok-zlinsym = ls_extension2-value.
            MODIFY ct_vbpok FROM ls_vbpok TRANSPORTING zlinsym.
          ENDIF.
        ENDLOOP.
      ENDIF.
    Please give your valueable suggesstions.
    Thanks.
    Rasika

    Hi,
    Check Line number 105 (Include lv50sfz1.) of Function module WS_DELIVERY_UPDATE_2 which called from the BAPI for updation of delivery.
    Documentation of include LV50SFZ1 reads
    * This include can be used for customer projects and IS-specific
    * enhancements
    * Location: After reading the delivery before any update is done
    Check whether the updated value is appearing in structure VBPOK_TAB inside this include.
    Regards
    Vinod

  • Add item with BAPI_OUTB_DELIVERY_CHANGE

    Hello,
    could you please provide me with some examples of adding position to delivery with BAPI_OUTB_DELIVERY_CHANGE? I have to add 'extra' item to outbound delivery for packaging material. With t-code VL02N it looks easy - you just complete information about 'auxiliary packaging material' (matnr, veanz, pstyv, werks, lgort) and new possition is added somehow to delivery. I have to do the same from BSP ... and I haven't found a way do this (all HU-related FMs just add position to HU but without changing delivery, WS_DELIVERY_UPDATE is not working as well).
    BAPI_OUTB_DELIVERY_CHANGE looks promising but so far I was unable to make it work.
    I am very looking forward to your tips ...
    Thank you,
    Filip

    Hi Michal,
    it is not possible to add an item to an outbound delivery via FM.
    I know - this information is not what you have expected - sad but true...
    I have used batch input via transaction VL02 to add packaging items to an outbound delivery. But VL02 is old fashioned and it has not the same functions as VL02N.
    Regards,
    Martin

  • Parameter NEW_ITEM_DATA in function module BAPI_OUTB_DELIVERY_CHANGE

    Hi, we have to add a new item to a delivery using ABAP. The function module BAPI_OUTB_DELIVERY_CHANGE has a parameter NEW_ITEM_DATA, but unfortunately no documentation about it. It Does anybody have an example on how to add a new item with this FM?
    Thanks for your help, best regards, Martin

    Hi,
    I have used this way:
    Loop at it_vbrp.
    CLEAR: wa_hdata, wa_hcont, d_delivy, it_bapiret2.
         wa_hdata-deliv_numb = it_vbrp-vgbel.
         wa_hcont-deliv_numb = it_vbrp-vgbel.
         wa_hcont-dlv_del    = c_x.
         d_delivy            = it_vbrp-vgbel.
    *---Deleting delivery doc (VL02)
         CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
           EXPORTING
             header_data    = wa_hdata
             header_control = wa_hcont
             delivery       = d_delivy
           TABLES
             return         = it_bapiret2.
    *---commit
           CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
             EXPORTING
               wait = 'X'.
    Endloop.
    Thanks,
    Krishna

  • How to change the storage location using BAPI_OUTB_DELIVERY_CHANGE

    Hi !
    I want to do batch split in the delivery using BAPI_OUTB_DELIVERY_CHANGE.
    Can anyone tell me how to pass/change the storage location of each batch item.
    Is there any other BAPI that can do the batch split and populate the storage location also for the split batches?
    Regards,
    Firoz.

    Hi all,
    BAPI_OUTB_DELIVERY_CHANGE  can be used to do batch split and updating storage loaction against each item of an outbond delivey.
    I have done that in the folllowing way:
    1 > Firstly i have updated the storage location for each delivery item using 'BAPI_OUTB_DELIVERY_CHANGE' passing some mininal parameters.
       Fetch the item details from LIPS table based on the outbound delivery and pass the corresponding fields to item_data, item_control  and item_data_spl parameters and passed into intenal table li_lips.
    Loop at li_lips inti lw_lips.
        lw_item_data-deliv_numb           = lw_lips-vbeln.
        lw_item_data-deliv_item             = lw_lips-posnr.
        lw_item_data-material                = lw_lips-matnr.
        lw_item_data-fact_unit_nom      = lw_lips-umvkz.
        lw_item_data-fact_unit_denom  = lw_lips-umvkn.
        lw_item_data-base_uom            = lw_lips-meins.
        lw_item_data-sales_unit            = lw_lips-vrkme.
        lw_item_control-deliv_numb      = lw_lips-vbeln.
        lw_item_control-deliv_item        = lw_lips-posnr.
        lw_item_data_spl-deliv_numb   = lw_lips-vbeln.
        lw_item_data_spl-deliv_item     = lw_lips-posnr.
        lw_item_data_spl-pick_denial   = 'X'.
        lw_item_data_spl-stge_loc       = v_lgort.
    "(This would be your Storage Location which you want to be updated)
    Appending work areas into internal table to pass as parameter
        APPEND lw_item_data_lgort     TO li_item_data_lgort .
    Appending work areas into internal table to pass as parameter
        APPEND lw_item_control_lgort  TO li_item_control_lgort.
    Appending work areas into internal table to pass as parameter
        APPEND lw_item_data_spl_lgort TO li_item_data_spl_lgort.
    endloop.
    Passing the delivery no in the work area of header data
      lw_header_data-deliv_numb           = v_delivery_no.
      lw_header_control-deliv_numb       = v_delivery_no.
      lw_header_tech_control-upd_ind   = 'U'.
    Calling BAPI to change the Storage location
      CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
        EXPORTING
          header_data       = lw_header_data
          header_control   = lw_header_control
          delivery               = v_delivery_no
          techn_control     = lw_header_tech_control
        TABLES
          item_data           = li_item_data
          item_control       = li_item_control
          return                 = li_return_change
          item_data_spl    = li_item_data_spl.
    Calling BAPI to committ the task
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' .
    2> Then i have used the same BAPI again 'BAPI_OUTB_DELIVERY_CHANGE' to do the batch split/update batch only(if required) and change the Actual Delivered Quantity.
    Here you have to pass the same thing along with actual delivery qauntity and different batches to do batch split.
    Here it is assumed that Batch numbers, actual delivered quantity are coming from an internal table i_lqua.
    Looping through Internal table to get Bin details
      LOOP AT i_lqua INTO w_lqua .
    Clearing work area before use
        CLEAR : lw_item_data, lw_lips, lw_item_control, lw_item_data_spl.
    Reading table comparing metrial number
        READ TABLE li_lips INTO lw_lips
        WITH KEY matnr = w_lqua-matnr BINARY SEARCH.
    If read is successful, passing values from table
        IF sy-subrc EQ 0.
    Passing the delivery details into Item level table
          lw_item_data-deliv_numb              = lw_lips-vbeln.
          lw_item_data-deliv_item                = lw_lips-posnr.
          lw_item_data-material                   = lw_lips-matnr.
          lw_item_data-batch                       = w_lqua-charg.
          lw_item_data-dlv_qty                    = w_lqua-verme.
          lw_item_data-dlv_qty_imunit         = w_lqua-verme.
          lw_item_data-base_uom               = w_lqua-meins.
          lw_item_data-hieraritem                = lw_lips-posnr.
          lw_item_data-usehieritm                = 1.
          lw_item_data-fact_unit_nom          = lw_lips-umvkz.
          lw_item_data-fact_unit_denom      = lw_lips-umvkn.
          lw_item_data-sales_unit                 = lw_lips-vrkme.
          lw_item_control-deliv_numb           = lw_lips-vbeln.
          lw_item_control-deliv_item             = lw_lips-posnr.
          lw_item_control-chg_delqty           = 'X'.
          lw_item_data_spl-deliv_numb        = lw_lips-vbeln.
          lw_item_data_spl-deliv_item          = lw_lips-posnr.
          lw_item_data_spl-stge_loc            = w_lqua-lgort.
          lw_item_data_spl-pick_denial        = 'X'
    Appending work area into internal table to pass as parameter
          APPEND  lw_item_data TO  li_item_data.
    Appending work area into internal table to pass as parameter
          APPEND lw_item_control TO li_item_control.
    Appending work area into internal table to pass as parameter
          APPEND lw_item_data_spl TO li_item_data_spl.
    Clearing work areas after use
          CLEAR : lw_item_data, w_lqua,lw_item_data_spl,lw_item_control,
                        lw_vbpok, lw_lips.
        ENDIF.
      ENDLOOP.
    Passing the delivery no in the work area of header data
      lw_header_data-deliv_numb           = v_delivery_no.
      lw_header_control-deliv_numb       = v_delivery_no.
      lw_header_tech_control-upd_ind   = 'U'.
    Calling BAPI to change the Batch/Batch-Split/Delivery Quantity
      CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
        EXPORTING
          header_data           = lw_header_data
          header_control       = lw_header_control
          delivery                   = v_delivery_no
          techn_control         = lw_header_tech_control
        TABLES
          item_data                = li_item_data
          item_control            = li_item_control
          return                     = li_return_change
          item_data_spl         = li_item_data_spl.
    Calling BAPI to committ the task
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' .
    This is the only way which i found as better way to do the Batch split and updating storage location togetherly.
    I hope this code will help you.

  • Problem with BAPI_OUTB_DELIVERY_CHANGE to update serial numbers

    hi All,
    I am using BAPI_OUTB_DELIVERY_CHANGE to update serial numbers. i am executing this directly in se37 giving delivery number alone in import parameters header_data, header_control and delivery.
    and giving delivery numer, item no and random serial no in tables ITEM_SERIAL_NO. when i execute  it is not throwing any errors. how ever the delivery is not updated with the serial no's.Return parameters is also nor showing any values.
    Any pointers to solve this would be appreciated.
    Regards,
    Sreekanth.

    Hi,
    You need to use BAPI_TRANSACTION_COMMIT just after BAPI_OUTB_DELIVERY_CHANGE .
    Mark WAIT = 'X' in the IMPORT parameter of BAPI_TRANSACTION_COMMIT.
    For testing if it is working or not:
    Goto SE37 --> click on FUNCTION MODULE --> TEST -->TEST SEQUENCES
    First give BAPI_OUTB_DELIVERY_CHANGE and then BAPI_TRANSACTION_COMMIT.
    Click on EXECUTE. Execute BAPI_OUTB_DELIVERY_CHANGE then 'BACK' and then BAPI_TRANSACTION_COMMIT with proper data.
    Goto the transaction from where you can check entry has been created or not.
    Regards

  • Help in BAPI_OUTB_DELIVERY_CHANGE

    Hi
    i try to change the quantity for a distributed quantity
    The code :
    *Local data --> Start
      DATA: LWA_HEADER_DATA LIKE  BAPIOBDLVHDRCHG,
            LWA_HEADER_CONTROL LIKE  BAPIOBDLVHDRCTRLCHG,
            LT_ITEM_DATA LIKE TABLE OF BAPIOBDLVITEMCHG,
            LWA_ITEM_DATA LIKE LINE OF LT_ITEM_DATA,
            LV_OLD_DELIV LIKE GWA_SD_DOCUMENT-VBELN,
            LV_NEW_DELIV LIKE GWA_SD_DOCUMENT-VBELN,
            LV_OLD_MATNR LIKE GWA_SD_DOCUMENT-MATNR,
            LV_NEW_MATNR LIKE GWA_SD_DOCUMENT-MATNR,
            LV_OLD_SHIP LIKE GWA_SD_DOCUMENT-TKNUM,
            LWA_TECHN LIKE BAPIDLVCONTROL,
            LT_ITEM_CONTROL LIKE TABLE OF BAPIOBDLVITEMCTRLCHG,
            LWA_ITEM_CONTROL LIKE LINE OF LT_ITEM_CONTROL,
            LV_NEW_SHIP LIKE GWA_SD_DOCUMENT-TKNUM,
            LT_RETURN LIKE TABLE OF BAPIRET2.
    *Local data --> End
      LWA_TECHN-UPD_IND = GC_DEFAULT.
      LOOP AT GT_SD_DOCUMENT INTO GWA_SD_DOCUMENT.
          LWA_ITEM_DATA-DELIV_NUMB = GWA_SD_DOCUMENT-VBELN.
          LWA_ITEM_DATA-DELIV_ITEM = GWA_SD_DOCUMENT-POSNR.
          LWA_ITEM_DATA-MATERIAL = GWA_SD_DOCUMENT-MATNR.
          LWA_ITEM_DATA-DLV_QTY = GWA_SD_DOCUMENT-LFIMG_R.
          LWA_ITEM_DATA-DLV_QTY_IMUNIT = GWA_SD_DOCUMENT-LFIMG_R.
          LWA_ITEM_DATA-SALES_UNIT = GWA_SD_DOCUMENT-VRKME.
          LWA_ITEM_DATA-BASE_UOM   = GWA_SD_DOCUMENT-MEINS.
          APPEND LWA_ITEM_DATA TO LT_ITEM_DATA.
          LWA_ITEM_CONTROL-DELIV_NUMB = GWA_SD_DOCUMENT-VBELN.
          LWA_ITEM_CONTROL-DELIV_ITEM = GWA_SD_DOCUMENT-POSNR.
          LWA_ITEM_CONTROL-CHG_DELQTY = GC_DEFAULT.
          APPEND LWA_ITEM_CONTROL TO LT_ITEM_CONTROL.
          CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
            EXPORTING
              HEADER_DATA    = LWA_HEADER_DATA
              HEADER_CONTROL = LWA_HEADER_CONTROL
              DELIVERY       = LV_OLD_DELIV
            TABLES
              ITEM_DATA      = LT_ITEM_DATA
              ITEM_CONTROL   = LT_ITEM_CONTROL
              RETURN         = LT_RETURN.
       ENDLOOP.
    I get message "Error in document &1 item &2 (quantity consistency check)"
    What is the problem?
    Thanks

    Hi,
    BAPI_OUTB_DELIVERY_CHANGE
    Regards
    Sudheer

  • Help in bapi bapi_outb_delivery_change

    Hi
    i want to use extension in the bapi bapi_outb_delivery_change
    but i don't unserdatns how to do it.
    Maybe you can send me an example how to do it!!!!
    Thanks
    Have a nice day

    Hi,
    BAPI_OUTB_DELIVERY_CHANGE
    Regards
    Sudheer

  • Error while using BAPI_OUTB_DELIVERY_CHANGE

    Hi Friends,
    I m using BAPI_OUTB_DELIVERY_CHANGE to change the delivery. But I m getting error - Error in document &1 item &2 (quantity consistency check).
    I m changing the delivered qty in batch-split and
    delivered qty in header  level.
    Is there any problem in code
    Some code snaps is:
    loop at itab.
        item_data1-DELIV_NUMB = s_vbeln.
        item_data1-DELIV_ITEM = 10.
        item_data1-DLV_QTY = itab-nt_qty.
           item_data1-UNIT_OF_WT = itab-unit.
        append item_data1.
      endloop.
      ITEM_CONTROL1-DELIV_NUMB = s_vbeln.
      item_control1-DELIV_ITEM = 10.
        item_control1-CHG_DELQTY = 'X'.
      append item_control1.
    CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
      EXPORTING
        HEADER_DATA               = header_data1
        HEADER_CONTROL            = header_control1
        DELIVERY                  = s_vbeln
      TECHN_CONTROL             =
    TABLES
      HEADER_PARTNER            =
      HEADER_PARTNER_ADDR       =
      HEADER_DEADLINES          =
        ITEM_DATA                 = item_data1
        ITEM_CONTROL              = item_control1
      ITEM_SERIAL_NO            =
      SUPPLIER_CONS_DATA        =
      EXTENSION1                =
      EXTENSION2                =
        RETURN                    = ret .
    Please help me.

    Hi friends, this can be solved setting values for the following additional parameters of structure ITEM_DATA.
    FACT_UNIT_NOM = 1.
    FACT_UNIT_DENOM = 1.
    This works for me, please let me know if this works for you!
    Regards
    Leonardo

  • DELETE Delivery with BAPI BAPI_OUTB_DELIVERY_CHANGE

    Hi all
    i try delete delivery with the bapi BAPI_OUTB_DELIVERY_CHANGE, but isn't don't.
    i don't know why, what's wrong
      loop at gt_likp assigning <gs_likp>.
        gf_delivery = <gs_likp>-vbeln.
        gs_header_data-deliv_numb = <gs_likp>-vbeln.
        gs_header_control-deliv_numb = <gs_likp>-vbeln.
        gs_header_control-dlv_del = 'X'.
        call function 'BAPI_OUTB_DELIVERY_CHANGE'
          exporting
            header_data                   = gs_header_data
            header_control                = gs_header_control
            delivery                      = gf_delivery
    *       TECHN_CONTROL                 =
    *       HEADER_DATA_SPL               =
    *       HEADER_CONTROL_SPL            =
    *       SENDER_SYSTEM                 =
          tables
    *       HEADER_PARTNER                =
    *       HEADER_PARTNER_ADDR           =
    *       HEADER_DEADLINES              =
    *       ITEM_DATA                     =
    *       ITEM_CONTROL                  =
    *       ITEM_SERIAL_NO                =
    *       SUPPLIER_CONS_DATA            =
    *       EXTENSION1                    =
    *       EXTENSION2                    =
            return                        = gt_bapiret2
    *       TOKENREFERENCE                =
    *       ITEM_DATA_SPL                 =
    *       COLLECTIVE_CHANGE_ITEMS       =
    thx

    Hi,
    1) Use BAPI_TRANSACTION_COMMIT after Bapi.
    2) Check whether any subsequent documents has been created against the delivery (Refer to VBFA table).
    Regards
    Vinod

Maybe you are looking for

  • Acrobat plug-in interfering with Safari quit

    I'm using Acrobat 8.0, Safari 3.2.3. When I quit Safari it quits normally but then I get an error message saying that Safari has quit without notice, probably due to an Acrobat Plug-in. So far it is an annoyance, not a substantive problem, but it mak

  • What causes ipod to go into disk mode

    I have an older ipod nano and out of the blue for no reason the other day when i picked it up it said something about how i needed to use itunes to restore. When i plug the ipod into itunes in says something about corrupted files and the ipod needs t

  • TS3408 how to clean cache and cookies?

    hi i just wanna know how to clean cache and cokies in my system..coz looks like it causes delayed in loading web pages.

  • PLEASE HELP !!! Exporting mix to mp3 leads to nothing ?

    Hi- I am a newb to Audition 3.0, but it seems I know just enough to be dangerous. I was hoping I could get some help with an issu I'm having- I have recorded about five tracks into Audition. I need to "flatten them" and then export the file to an mp3

  • Flex Developer in Alpharetta,GA

    I am looking for a seasoned Flex/RIA developer to join my team on a green-field development project. This is a contract or full-time position. We are a small agile development team and will be developing a diagnostic and provision system for cable ne