Problem in BAPI_OUTB_DELIVERY_CHANGE

Hi All,
I want to change the Item level Delivery Quantity in VL02N. I tried to use BAPi_OUTB_DELIVERY_CHANGE. But i did not succeed. I am passing the below parameters.
HEADER_DATA -
> Delivery Number
DELIVERY -
> Delivery Number
ITEM_DATA -
> DELIV_NUMB(Delivery Number), DELIV_ITEM(Item), MATERIAL(material), DLV_QTY(Qty what i need to update in VL02n), FACT_UNIT_NOM(as 1), FACT_UNIT_DENOM (as 1), SALES_UNIT(VRKME), BASE_UOM(MEINS)
ITEM_CONTROL -
> DELIV_NUMB(delivery Number), DELIV_ITEM(Item), CHG_DELQTY(as 'X')
im passing the above parameters to change the delivery quantity at item level . where as im not at all succeding to change the delivery qty.
Helpful answers will reward.
Thanks,
Srinivas.

Hi Srinivas,
If you want to change the quantity for a delivery, then following entries are required:
(1) In the header data of outbound delivery parameter (HEADER_DATA) - the delivery number (DELIV_NUMB)
(2) In parameter item data of outbound delivery (ITEM_DATA)
         the delivery number (DELIV_NUMB), the delivery item (DELIV_ITEM), the delivery quantity in sales unit (DLV_QTY),
         the actual delivery quantity in base UoM (DLV_QTY_IMUNIT), the sales unit (SALES_UNIT),
         the ISO code for the sales unit (SALES_UNIT_ISO), the base unit of measure (BASE_UOM),
         the ISO code for the base unit of measure (BASE_UOM_ISO)
(3) In the control of the outbound delivery at item level parameter (ITEM_CONTROL)
        the delivery number (DELIV_NUMB), the delivery item (DELIV_ITEM), the Change Delivery Quantity indicator(CHG_DELQTY)
(4) If you do not make any further entries, the system copies the material number, plant, quantities as floating point numbers, 
       volumes, weights, and their units from the original outbound delivery document.
(5) After this DONOT forget to call the Function Module BAPI_TRANSACTION_COMMIT. The reason being that it is MANDATORY to call this FM after every BAPI Call so that the values get updated to the database otherwise they'll not.
Hope that this helps you out in updating the Outbound Delivery Quantity. Reward if useful.
Thanks and Regards,
Maddineni Bharath.

Similar Messages

  • Problem WIth BAPI_OUTB_DELIVERY_CHANGE

    Hi All,
    I want to change the Item level Delivery Quantity in VL02N. I tried to use BAPi_OUTB_DELIVERY_CHANGE. But i did not succeed. I am passing the below parameters.
    HEADER_DATA -
    > Delivery Number
    DELIVERY -
    > Delivery Number
    ITEM_DATA -
    > DELIV_NUMB(Delivery Number), DELIV_ITEM(Item), MATERIAL(material), DLV_QTY(Qty what i need to update in VL02n), FACT_UNIT_NOM(as 1), FACT_UNIT_DENOM (as 1), SALES_UNIT(VRKME), BASE_UOM(MEINS)
    ITEM_CONTROL -
    > DELIV_NUMB(delivery Number), DELIV_ITEM(Item), CHG_DELQTY(as 'X')
    im passing the above parameters to change the delivery quantity at item level . where as im not at all succeding to change the delivery qty.
    <REMOVED BY MODERATOR>
    Thanks,
    Srinivas.
    Edited by: Alvaro Tejada Galindo on Apr 7, 2008 5:24 PM

    Please, see de function module documentations. The example in red color.
    If you want to change the quantity for a distributed quantity, then following entries are required for the transfer to the connected system:
    In the header data of outbound delivery parameter (HEADER_DATA)
    The delivery number (DELIV_NUMB)
    In parameter item data of outbound delivery (ITEM_DATA)
    The delivery number (DELIV_NUMB)
    The delivery item (DELIV_ITEM)
    The delivery quantity in sales unit (DLV_QTY)
    The actual delivery quantity in base UoM (DLV_QTY_IMUNIT)
    The sales unit (SALES_UNIT)
    The ISO code for the sales unit (SALES_UNIT_ISO)
    The base unit of measure (BASE_UOM)
    The ISO code for the base unit of measure (BASE_UOM_ISO)
    In the control of the outbound delivery at item level parameter (ITEM_CONTROL)
    The delivery number (DELIV_NUMB)
    The delivery item (DELIV_ITEM)
    The Change Delivery Quantity indicator(CHG_DELQTY)
    If you do not make any further entries, the system copies the material number, plant, quantities as floating point numbers, volumes, weights, and their units from the original outbound delivery document..
    Notes
    Changes to the packing data are not synchronized in the central ERP system.
    For subsequent changes to a distributed inbound delivery, the following prerequisites must be fulfilled:
    All items in the distribution-relevant inbound delivery have the same decentrally-managed warehouse number.
    You have generated a distribution model for inbound deliveries. For more information, see the implementation guide (IMG) under Logistics Execution -> Decentralized WMS Integration -> Central Processing -> Distribution -> Generate Distribution Model.
    In Customizing for Shipping under Deliveries  -> Define Delivery Types -> Distribution Mode, you have specified whether the system should distribute the delivery automatically after document creation, or whether distribution should be suppressed so that you can trigger distribution yourself using the delivery monitor.
    If you use an external system as the decentralized WMS, you must ensure that there is a blocking system for the decentralized system, which prevents a delivery from being processed in both systems at the same time. For more information on the cross-system lock, see the SAP Library under Basis -> Client-Server Technology -> Cross-System Lock (CSL).
    If you use the asynchronous interface for the actual transfer of the outbound delivery changes (IDoc category SHP_OBDLV_CHANGE), you must make sure that the structure definition of the IDoc is correct as you construct the IDoc. You should take particular care not to switch the segment sequence.
    []'s.
    Marcus Farias.
    Edited by: Marcus Farias on Apr 8, 2008 8:48 AM

  • 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

  • Issue with BAPI_OUTB_DELIVERY_CHANGE

    Hi,
    I am getting the error There was no entry found in table &1 while using the BAPI_OUTB_DELIVERY_CHANGE and when i debugged this BAPI , the table for placeholder &1 was found to be TPAER.
    when i checked this table, the entries were correct. could anyone suggest whether there are some other related configurations.
    I am using this BAPI to update the partner details for a delivery.

    Hi,
    See the given link, hope it will help you.
    Re: problem with BAPI_OUTB_DELIVERY_CHANGE to update serial numbers
    Regards,
    Shamma

  • 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

  • Problem in changing delivery qty through 'BAPI_OUTB_DELIVERY_CHANGE'

    Dear friends.
    i  am passing all the parameters according to documentation.
    yet the del qty is not getting updated. Return message is like this:
    (Required field in interface to delivery update missing &1 &2 &3 &4)
    please help me.
    here i am giving my code.
    gs_header_data-deliv_numb        = '0080000228'  .
    gs_header_control-deliv_numb    = '0080000228'  .
    gs_delivery-deliv_numb           = '0080000228' .
    gs_item_data-deliv_numb         = '0080000228'  .
    gs_item_data-deliv_item         ='000010'  .
    gs_item_data-material           = '307045229000306LG1'  .
    gs_item_data-batch              = '0STOCKYARD'..
    gs_item_data-hieraritem         = ' '  .
    gs_item_data-dlv_qty            =   '61.656'.    *********** New del qty
    gs_item_data-dlv_qty_imunit     =  '61.656'.   .******* please confirm this.....?????
    gs_item_data-fact_unit_nom      = '00001'  .
    gs_item_data-fact_unit_denom    = '00001'  .
    gs_item_data-sales_unit         = 'TO'  .
    gs_item_data-sales_unit_iso     = 'TNE'  .
    gs_item_data-base_uom           = 'TO'  .
    gs_item_data-base_uom_iso       = 'TNE'  .
    APPEND gs_item_data TO gt_item_data.
    gs_item_control-deliv_numb         = '0080000044'  .
    gs_item_control-deliv_item         = '000010'  .
    gs_item_control-chg_delqty         = 'X'  .
    APPEND gs_item_control TO gt_item_control.
    CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
      EXPORTING
        header_data                   = gs_header_data
        header_control                =  gs_header_control
        delivery                      = gs_header_data-deliv_numb
      TABLES
       item_data                     = gt_item_data
       item_control                  = gt_item_control
        return                        = gt_bapiret2

    HI,
    After calling BAPI_OUTB_DELIVERY_CHANGE function,
    did u call  BAPI_TRANSACTION_COMMIT?
    Hope it helps u........

  • Batch splitting for Outbound delivery using BAPI_OUTB_DELIVERY_CHANGE

    Hi all,
    Let me explain the scenario first.
    We are going to create a delivery in SAP with some line items and send it to a non-sap third party WMS.  They will pick the goods and send the delivery confirmation back to SAP.  In SAP we need to delivery confirmation and PGI.
    The problem is when the third Part WMS does a batch split for a particular line item, we need to update the same in SAP and then do the PGI.  For this I was trying to use BAPI_OUTB_DELIVERY_CHANGE to create split batches.  It is splitting the batches but the overall pick status is becoming B (Partially picked).  SO it is not allowing to do the PGI.
    Can anyone solve my problem

    Hi Bala,
    make sure you are setting...
    itemdata-dlv_qty
    itemdata-dlv_qty_imunit
    itemdata-fact_unit_nom     e.g = 1.
    itemdata-fact_unit_denom  e.g = 1.
    Rgds
    Glenn

  • Some quetions about BAPI_OUTB_DELIVERY_CHANGE.

    HI~all.
       I change serial number in a outbound delivery use this bapi,
    but have  a question which it will create a new Object list number when i run this bapi at a time ,you can find them from SER01 TABLE,what's happend?PLZ tell me if you know the problem ,thank you very much ~
    following is my code.
    *& Report  ZDN_MOD
    REPORT  ZDN_MOD.
    DATA:BEGIN OF it_lips OCCURS 1,
               vbeln LIKE lips-vbeln,
               posnr LIKE lips-posnr,
               matnr LIKE lips-matnr,
               werks LIKE lips-werks,
               lfimg LIKE lips-lfimg,
               umvkz LIKE lips-umvkz,
               umvkn LIKE lips-umvkn,
         END OF it_lips.
    DATA:IT_OBJK LIKE OBJK OCCURS 0 WITH HEADER LINE.
    data:l_OBKNR like SER01-OBKNR.
    DATA:  v_delivery  LIKE bapiobdlvhdrchg-deliv_numb,
           wa_header   LIKE bapiobdlvhdrchg,
           wa_header_x LIKE bapiobdlvhdrctrlchg,
           WA_TECHN   LIKE BAPIDLVCONTROL,
           it_return   LIKE bapiret2 OCCURS 0 WITH HEADER LINE,
           it_item     LIKE bapiobdlvitemchg OCCURS 0 WITH HEADER LINE,
           it_item_x   LIKE bapiobdlvitemctrlchg OCCURS 0 WITH HEADER LINE,
           it_spl      LIKE /spe/bapiobdlvitemchg OCCURS 0 WITH HEADER LINE,
           it_SER_NO like BAPIDLVITMSERNO OCCURS 0 WITH HEADER LINE,"&#24207;&#21015;&#21495;&#20869;&#34920;
           d_vbeln like likp-vbeln,
           msgtxt(100) type c .
    data:it_CWM_ITEM_DATA LIKE /CWM/BAPIOBDLVITEM OCCURS 0 WITH HEADER LINE.
    SELECT SINGLE OBKNR INTO L_OBKNR FROM SER01 WHERE LIEF_NR = '0080000040' AND POSNR = '000010'.
    select * from OBJK into table it_OBJK where OBKNR = l_OBKNR.
    D_VBELN = '0080000040'.
    wa_header-deliv_numb = d_vbeln.
    wa_header_x-deliv_numb = d_vbeln.
    *wa_header_x-SIMULATE    = 'X'.
    v_delivery = D_VBELN.
    WA_TECHN-UPD_IND = 'X'.
    SELECT vbeln posnr matnr werks lfimg umvkz umvkn into
           TABLE it_lips FROM lips
         WHERE vbeln = d_vbeln
         AND   POSNR = '000010'.
    LOOP AT it_lips.
      it_item-deliv_numb = it_lips-vbeln.
      it_item-deliv_item = it_lips-posnr.
      it_item-material   = it_lips-matnr.
      it_item-dlv_qty    = it_lips-lfimg.
      it_item-fact_unit_nom = it_lips-umvkz.
      it_item-fact_unit_denom = it_lips-umvkn.
      it_item-CONV_FACT = '1'.
      it_item-SALES_UNIT = 'SET'.
      APPEND it_item. CLEAR it_item.
      loop at it_OBJK.
        it_SER_NO-DELIV_NUMB = it_lips-vbeln.
        it_SER_NO-ITM_NUMBER = it_lips-posnr.
        it_SER_NO-SERIALNO   = it_OBJK-EQUNR.
        APPEND it_SER_NO.
      endloop.
      it_item_x-deliv_numb = it_lips-vbeln.
      it_item_x-deliv_item = it_lips-posnr.
      it_item_x-CHG_DELQTY  = 'X'.
      APPEND    it_item_x .CLEAR    it_item_x.
    ENDLOOP.
    CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
      EXPORTING
        header_data    = wa_header
        header_control = wa_header_x
        delivery       = v_delivery
        TECHN_CONTROL  = WA_TECHN
      TABLES
        item_data      = it_item
        item_control   = it_item_x
        ITEM_SERIAL_NO = it_SER_NO
        return         = it_return
        item_data_spl  = it_spl.
    READ TABLE it_return WITH KEY type = 'E'.
    BREAK IBM-ZHANGDQ.
    IF sy-subrc NE 0.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = 'X'.
    ELSE.
      CALL FUNCTION 'FORMAT_MESSAGE'
        EXPORTING
          id        = it_return-id
          lang      = '-D'
          no        = it_return-number
          v1        = it_return-message_v1
          v2        = it_return-message_v2
          v3        = it_return-message_v3
          v4        = it_return-message_v4
        IMPORTING
          msg       = msgtxt
        EXCEPTIONS
          not_found = 1
          OTHERS    = 2.
      WRITE:msgtxt.
    ENDIF.
    FREE:it_return,it_spl,it_item,it_item_x.
    CLEAR:it_return,it_spl,it_item,it_item_x,wa_header,
          wa_header_x,v_delivery.

    Hello Srinivas
    I am still on this and felt I must continue updating this message thread so that someone with a similar requirement can get a complete picture of what the possibilities are and benefit from it.
    I am trying out your suggested solution but am unsure of the FM which needs to be attached to the event tcode with the LIKP event CHANGED. That is one area I will need your feedback and help. Might be very helpful if I had your case scenario too and the FM code to see if it can be reused.
    Also I didn't understand the reason for the new field flag?
      xlips-zfield = 'X'.   " new FLAG.
    Did you mean for me to add a new field to LIPS to keep track of pick omit line items? And kind of use it like a flag and reset it once I am done processing or something like that?
    In the TCode SWETYPV
    BOR Object Type     LIKP CHANGED       WS12300004 No errors
    BOR Object Type     LIKP CREATE_IBDLV WS12300004 No errors
    But not sure if that is the right way. I am trying to look up more documentation on this but not finding any.
    Meetings within the department have definitely given a deeper view of the requirements....
    While updating the pick omits delv. qty is the first step the next step is to rej the line item with a reason code. The discussions also revealed more points which were seeming to fit into this jigsaw with a little addition. The additional functionality is to consolidate all like items to one line item, prior to order going to warehouse for picking. This will aid in picking at the warehouse as well as in the customer invoice not reflecting more than one line item for the same material. In the case where the customer has truly ordered more than 1 case and additional 2 EA (eaches) the documents in SAP will still reflect 2 lines.
    Regards

  • Function Module BAPI_OUTB_DELIVERY_CHANGE missing SDABW

    Our company has a business requirement to base shipping method on the weight of the shipment.
    In order to achieve this, we group deliveries into a shipment to reach an aggregate weight.
    We were using incoterms to determine if we would charge the customer for freight or not -- but we are getting away from this method and we want to use Special Processing Indicator (SDABW) to do this instead.
    Our plan is when SDABW = Z003 and the weight threshhold is met, function module BAPI_OUTB_DELIVERY_CHANGE should change the delivery.
    Our problem is that the field SDABW is not included in BAPI_OUTB_DELIVERY_CHANGE.
    Does anyone know a way to add this to the FM? Or is there another FM that we could use?

    Check whether any of the includes FV50C002, LV05IFLV, L0VTRF00, L0VVTF00 could help you. Also take a look at OSS  Note 606769 - XSI_GET_SERVICE_CD_SDABW and XSI_GET_SERICE_CD_LPRIO, which talks about couple of function modules.
    Thanks,

  • 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

  • I have a problem in using the function 'WS_DELIVERY_UPDATE'

    I want to update the delivery document at the batch field (CHARG = '0000000605') by using the function 'WS_DELIVERY_UPDATE'.
    Before update, this batch field is initial.
    After having completely updated this delivery, I try to update this batch field again. However, I found the error message showing that 'Confirmed batch 0000000621 is different from batch 0000000605 for main item'.
    How can I solve this problem to update this batch again? This error occurs when I use function 
    'WS_DELIVERY_UPDATE', 'BAPI_OUTB_DELIVERY_CONFIRM_DEC', and 'BAPI_OUTB_DELIVERY_CHANGE'.

    Check OSS 674567.

  • 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

  • Problem in Delivery Split - BAPI_OUTB_DELIVERY_SPLIT_DEC

    Dear friends,
    Iam facing a problem on Delivery Split
    My Requirement : I have a delivery A with Item 000010 and Batches 10,20,30,40,50 in ERP system. I have a third party system which wil create a new delivery B for this Original delivery A and associate batches 20, 30 - Means... the Third party system is splitting the delivery A to delivery A and B and associate
    Delivery A with Batches 10, 40 and 50
    New Delivery B with Batches 20 and 30.
    What am I trying to do is
    Step 1. I am trying to create a new delivery B using "BAPI_OUTB_DELIVERY_SPLIT_DEC"
    Step 2. Ill do a Batch Split for B using "BAPI_OUTB_DELIVERY_CHANGE"
    Step 3. Ill delete the Batches 20 and 30 which are used in Delivery B from Delivery A.
    Usage of "BAPI_OUTB_DELIVERY_SPLIT_DEC"
        wa_item-deliv_numb            = p_n_dlv.   "New Delivery Number  "65000000
        wa_item-deliv_item            = p_n_psn.     "New Delivery Item      "000010
        wa_item-curr_qty              = 'B'.       "Base Unit (B) / Sales Unit (A)
        wa_item-dlv_qty               = lv_qty.                                               "40
    *wa_item-DEL_QTY_FLO           =
        wa_item-sales_unit            = wa_lips-vrkme.                                "MSF
        wa_item-isocode_sales_unit    = wa_lips-vrkme .                             "MSF
        wa_item-dlv_qty_stock         = lv_qty.                                           "40
    *wa_item-DLV_QTY_ST_FLO        =
        wa_item-base_uom              = wa_lips-meins.                             "MSF
        wa_item-base_uom_iso          = wa_lips-meins.                            "MSF
        wa_item-sales_qty_num         = 1.
        wa_item-sales_qty_denom       = 1.
        wa_item-convfactor            = wa_lips-umrev.                             "0.00000000000.....0+0
        APPEND wa_item TO lt_items.
        CALL FUNCTION 'BAPI_OUTB_DELIVERY_SPLIT_DEC'
          EXPORTING
            delivery                    = p_vbeln
            deliverynew                 = p_n_dlv
            deliveryitemsbelongto       = p_dlv_md  "N        
            businessprocess             = 'Z006'
      TECHNCONTROL                =
          TABLES
            itemdata                    = lt_items
      EXTENSIONIN                 =
            return                      = l_return
      ITEM_SERIAL_NO              =
    Errors which Iam getting
    E   |LEDSP               |037   |                                         <
    E   |LEDSP               |025   |                                         <
    Waiting for some good suggestions!...
    <removed by moderator>
    Cheers,
    Kripa Rangachari.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = LV_WAIT.
    Edited by: Thomas Zloch on Feb 19, 2011 1:38 PM - please do not promise ...

    Hey all!.....
    The BAPI "BAPI_OUTB_DELIVERY_SPLIT_DEC" works for Delivery Split ... with the parameter values which Iam passing.
    The problem was the data which is used for testing!..... The customized split profile which is used "Z006" doesnt pick up the delivery data given for splitting ....
    Used a different data - and the new delivery number got created!
    Cheers,
    Kripa Rangachari.

  • 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

  • Batch split using BAPI_OUTB_DELIVERY_CHANGE

    I want to use BAPI_OUTB_DELIVERY_CHANGE to edit the D/O to add in the batch split and serial no. I pass in the following parameters:
    delivery = '0080740827'.
    item_data-deliv_numb = '0080740827'.
    item_data-deliv_item = '00010'.
    item_data-material   = 'SL15C-ACPOA-003'.
    item_data-dlv_qty    = 0.
    append item_data
    item_data-deliv_numb = '0080740827'.
    item_data-deliv_numb = '90001'.
    item_data-deliv_item = '00010'.
    item_data-material   = 'SL15C-ACPOA-003'.
    item_data-hieraritem = '00010'.
    item_data-usehieritm = '1'.
    item_data-batch      = '20483602'.
    item_data-dlv_qty    = 2.
    append item_data.
    item_serial_no-deliv_numb = '0080740827'.
    item_serial_no-itm_number = '90001'.
    item_serial_no-serialno   = '74714'.
    append item_serial_no.
    item_serial_no-deliv_numb = '0080740827'.
    item_serial_no-itm_number = '90001'.
    item_serial_no-serialno   = '74755'.
    append item_serial_no.
      CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
      EXPORTING
       header_data               =
       header_control            =
        delivery                  = delivery
      TECHN_CONTROL             =
      TABLES
      HEADER_PARTNER            =
      HEADER_PARTNER_ADDR       =
      HEADER_DEADLINES          =
       item_data                 =  item_data
       item_control              =  item_control
       item_serial_no            =  item_serial_no
      SUPPLIER_CONS_DATA        =
      EXTENSION1                =
      EXTENSION2                =
        return                    = return.
      TOKENREFERENCE            =
    When I run the program, the system has error and ask me to put in header_data and header_control. I dont want to change the header_data, I just want to change the item data, how do I fill in header_data and header_control? is my parameters correct?

    declare internal table for header_data and header_control. and dont append any values to it. simply assign it.
    CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
    EXPORTING
    header_data = header_data
    header_control = header_control
    delivery = delivery
    TECHN_CONTROL =
    TABLES
    HEADER_PARTNER =
    HEADER_PARTNER_ADDR =
    HEADER_DEADLINES =
    item_data = item_data
    item_control = item_control
    item_serial_no = item_serial_no
    SUPPLIER_CONS_DATA =
    EXTENSION1 =
    EXTENSION2 =
    return = return.
    TOKENREFERENCE =
    May be it will solve your problem.
    Thanks
    Muthappan

Maybe you are looking for