Error in Inbound delivery using 'BAPI_INB_DELIVERY_CHANGE'

Hi,
I want to delete Inbound delivery.i got the erro that document cant be deleted(VL-66), how to correct this
I passed the belwo entry. let me know if i m missing anything.
I tried with and withou item_data and item_control(as i have commented) but no use.
i just want to delete the inbound delivery say evry thing be 0 so i was passing 0 as quantity
wa_inb_head-deliv_numb = '0180036237'.
    wa_inb_ctrl-deliv_numb = '0180036237'.
     wa_inb_ctrl-dlv_del    = 'X'.
      wa_inb_delivery             = '0180036237'.
  wa_item_ctrl-DELIV_NUMB = '0180036237'.
  wa_item_ctrl-CHG_DELQTY = 'X'.
  append wa_item_ctrl to it_ctrl.
*wa_data-DELIV_NUMB = '0180036237'.
       wa_data-DLV_QTY = '0'.
*wa_data-DLV_QTY_IMUNIT = '0'.
*append wa_data to it_data.
     CALL FUNCTION 'BAPI_INB_DELIVERY_CHANGE'
          EXPORTING
            HEADER_DATA                =  wa_inb_head
            HEADER_CONTROL             =  wa_inb_ctrl
            DELIVERY                   =  wa_inb_delivery
          TABLES
           item_data          = it_data
           item_control             = it_ctrl
           RETURN                     = it_bapiret2.

Please check the inbound delivery you are trying to delete is not having goods receipt status as 'completed' OR not having HANDLING UNITS assigned to it.
In any of the above case, please reverse the goods receipt first, then unassign the handling units and then try to delete the inbound delivery. In my opinion, there should be no need to change the qty to 0 and just delete the inbound delivery should work.
In case you still encounter an error, try deleting the delivery using VL32n and you should get a clear error/problem for your case.

Similar Messages

  • Update Delivery Qty of  Inbound Delivery using BAPI_INB_DELIVERY_CHANGE

    Hi Experts,
    I'm trying to use  BAPI_INB_DELIVERY_CHANGE to update the delivery quantity of a line item in an Inbound Delivery. However, I keep on getting this error:
    Type: E
    ID: VLBAPI
    Number: 004
    Text: Error in document &1 item &2 (quantity consistency check)
    Below is my test program. Any input will be much appreciated.
    REPORT  ztest.
    DATA: deadlines LIKE bapidlvdeadln OCCURS 0.
    DATA: wa_deadlines LIKE bapidlvdeadln.
    DATA: header_data_t LIKE bapiibdlvhdrchg OCCURS 0.
    DATA: wa_header_data LIKE bapiibdlvhdrchg.
    DATA: header_control_t LIKE bapiibdlvhdrctrlchg OCCURS 0.
    DATA: wa_header_control LIKE bapiibdlvhdrctrlchg.
    DATA: item_data LIKE bapiibdlvitemchg OCCURS 0.
    DATA: wa_item_data LIKE bapiibdlvitemchg.
    DATA: item_control LIKE bapiibdlvitemctrlchg OCCURS 0.
    DATA: wa_item_control LIKE bapiibdlvitemctrlchg.
    DATA: header_data_t_con LIKE bapiibdlvhdrcon OCCURS 0.
    DATA: wa_header_data_con LIKE bapiibdlvhdrcon.
    DATA: header_control_t_con LIKE bapiibdlvhdrctrlcon OCCURS 0.
    DATA: wa_header_control_con LIKE bapiibdlvhdrctrlcon.
    DATA: item_data_con LIKE bapiibdlvitemcon OCCURS 0.
    DATA: wa_item_data_con LIKE bapiibdlvitemcon.
    DATA: item_control_con LIKE bapiibdlvitemctrlcon OCCURS 0.
    DATA: wa_item_control_con LIKE bapiibdlvitemctrlcon.
    DATA: return TYPE STANDARD TABLE OF bapiret2.
    CLEAR: wa_header_data, wa_header_control.
    wa_header_data-deliv_numb = '0180000545'.
    wa_header_data-gross_wt = '3001.000'.
    *wa_header_data-NET_WEIGHT = '3001.000'.
    wa_header_data-unit_of_wt = 'KG'.
    wa_header_data-volume = '1500.5'.
    wa_header_data-volumeunit = 'M3'.
    APPEND wa_header_data TO header_data_t.
    wa_header_control-deliv_numb = '0180000545'.
    wa_header_control-NET_WT_FLG = 'X'.
    wa_header_control-volume_flg = 'X'.
    wa_header_control-gross_wt_flg = 'X'.
    *wa_HEADER_CONTROL-DELIV_DATE_FLG = 'X'.
    APPEND wa_header_control TO header_control_t.
    CLEAR: wa_item_data.
    wa_item_data-deliv_numb = '0180000545'.
    wa_item_data-deliv_item = '000020'.
    wa_item_data-dlv_qty = '3000'.
    wa_item_data-dlv_qty_imunit = '3000'.
    wa_item_data-sales_unit = 'KG'.
    wa_item_data-sales_unit_iso = 'KG'.
    wa_item_data-base_uom = 'KG'.
    wa_item_data-base_uom_iso = 'KG'.
    wa_item_data-gross_wt = '3000'.
    wa_item_data-unit_of_wt = 'KG'.
    wa_item_data-volume = '1500'.
    wa_item_data-volumeunit = 'M3'.
    APPEND wa_item_data TO item_data.
    CLEAR: wa_item_control.
    wa_item_control-deliv_numb = '0180000545'.
    wa_item_control-deliv_item = '000020'.
    wa_item_control-chg_delqty = 'X'.
    wa_item_control-VOLUME_FLG = 'X'.
    wa_item_control-NET_WT_FLG = 'X'.
    wa_item_control-GROSS_WT_FLG = 'X'.
    APPEND wa_item_control TO item_control.
    CALL FUNCTION 'BAPI_INB_DELIVERY_CHANGE'
    EXPORTING
    header_data = wa_header_data
    header_control = wa_header_control
    delivery = '0180000545'
    * TECHN_CONTROL =
    TABLES
    * HEADER_PARTNER =
    * HEADER_PARTNER_ADDR =
    * HEADER_DEADLINES = deadlines
    item_data = item_data
    item_control = item_control
    * ITEM_SERIAL_NO =
    * EXTENSION1 =
    * EXTENSION2 =
    return = return
    * TOKENREFERENCE =
    * HANDLING_UNIT_HEADER =
    * HANDLING_UNIT_ITEM =
    * PARTIAL_GR_OBJECTS =
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

    Hi,
    Pls try to use the other structure
    ORDER_SCHEDULES_INX type BAPISCHDLX bcoz it is used to update the required field.
    Now for the date field add the required days to set it as future date.
    ex:
    l_date = l_date + 12. // it will be set to future or requred date.
    Reward if helpful.
    Regards
    Chandralekha

  • Update GR quantity in Inbound delivery using 'BAPI_INB_DELIVERY_CHANGE'

    Hello SDNs,
    I have a requirement to update quantity delivered post GR in the Inbound delivery. I'm using 'BAPI_INB_DELIVERY_CHANGE' to do the updation in program. The database is not updated with new quantity.
    BAPI returns error message in "Return" table with ID VLBAPI . I'm unable to detect where the problem is.
    Below is my code. Please help me resolve it.
      loop at it_final.
        CLEAR g_delivery.
        g_delivery = it_final-text(10).
    *   g_delivery = '0180000221'.
        g_del_item = it_final-text+10(6).
    *    g_del_item = '10'.
        g_material = it_final-text+16(18).
        g_dlv_qty = it_final-text+34(13).
        select single * from lips into wa_lips
            where vbeln = g_delivery
              and posnr = g_del_item
              and matnr = g_material.
        if sy-subrc eq 0.
          wa_lips-lfimg = g_dlv_qty.
          modify lips from wa_lips.
          check sy-subrc eq 0.
        endif.
        CLEAR gt_header_data.
        REFRESH gt_header_data.
        gt_header_data-deliv_numb = g_delivery.
        gt_header_data-volumeunit = wa_lips-voleh.
        APPEND gt_header_data.
        CLEAR gt_header_ctrl.
        REFRESH gt_header_ctrl.
        gt_header_ctrl-deliv_numb = g_delivery.
    *    gt_header_ctrl-no_lock = 'Y'.
        APPEND gt_header_ctrl.
        clear gt_tech_ctrl.
        refresh gt_tech_ctrl.
        gt_tech_ctrl-UPD_IND = 'X'.
        gt_tech_ctrl-DLV_TYPE = 'EL'.
        append gt_tech_ctrl.
        CLEAR gt_data.
        REFRESH gt_data.
        gt_data-deliv_numb = g_delivery.
        gt_data-deliv_item = g_del_item.
        gt_data-material = g_material.
        gt_data-dlv_qty = wa_lips-lfimg.
        gt_data-sales_unit = wa_lips-vrkme.
        gt_data-base_uom = wa_lips-meins.
        gt_data-dlv_qty_imunit = g_dlv_qty.
    *   gt_data-base_uom_iso =
    *    gt_data-
        APPEND gt_data.
        REFRESH gt_ctrl.
        gt_ctrl-deliv_numb = g_delivery.
        gt_ctrl-deliv_item = g_del_item.
    * gt_ctrl-del_item   = ' '.
        gt_ctrl-CHG_DELQTY = 'X'.
        APPEND gt_ctrl.
        CALL FUNCTION 'BAPI_INB_DELIVERY_CHANGE'
          EXPORTING
            HEADER_DATA                = gt_header_data
            HEADER_CONTROL             = gt_header_ctrl
            DELIVERY                   = g_delivery
            TECHN_CONTROL              = gt_tech_ctrl
          TABLES
    *   HEADER_PARTNER             =
    *   HEADER_PARTNER_ADDR        =
    *   HEADER_DEADLINES           =
           ITEM_DATA                  = gt_data
          ITEM_CONTROL               =  gt_ctrl
    *   ITEM_SERIAL_NO             =
    *   EXTENSION1                 =
    *   EXTENSION2                 =
            RETURN                     = return
    *   TOKENREFERENCE             =
    *   HANDLING_UNIT_HEADER       =
    *   HANDLING_UNIT_ITEM         =
    *   PARTIAL_GR_OBJECTS         =
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            WAIT = ' '.
    endloop.
    Thanks
    Shruti

    Please check the inbound delivery you are trying to delete is not having goods receipt status as 'completed' OR not having HANDLING UNITS assigned to it.
    In any of the above case, please reverse the goods receipt first, then unassign the handling units and then try to delete the inbound delivery. In my opinion, there should be no need to change the qty to 0 and just delete the inbound delivery should work.
    In case you still encounter an error, try deleting the delivery using VL32n and you should get a clear error/problem for your case.

  • While doing inbound delivery using VL31N

    While doing inbound delivery using the T-code VL31N , am getting the error message " Factory calendar  is not recognised "
    Guys Please help me out

    Hello ,
    while doing the PO in the item detail  confirmations tab i have selected the inbound delivery ECC and saved .After that i tried to create the inbound delivery for the PO at that time am getting the message 'factory calender is not recognised " .
    I have checked in the factory calender which is assigned to controlling area is"  K4 "
    Please help me out

  • Change inbound delivery using /SPE/IDOC_INPUT_DESADV1

    Hello -
    We are creating an inbound delivery using the idoc function module /SPE/IDOC_INPUT_DESADV1.  I have need to be able to change an existing delivery via idoc processing, so we are populating and mapping an E1EDL18 segment with the qualifier 'CHG'.  However, in /SPE/IDOC_INPUT_DESADV1, it does not appear to handle CHG.  I have debugged down into the code and in method PARSE_AND_HANDLE_IDOC_DELVRY03, when the segment is E1EDL18, there is a case statement that looks at the qualifier, and CHG is not dealt with. 
    Any ideas how to handle this?  Or is this a legitimate bug I should report to SAP?
    Thanks for any help!
    Sharon McClure

    Sharon McClure wrote:
    Or is this a legitimate bug I should report to SAP?
    Hard to say. Why not just report it? The worst they can do is say it's a consulting issue.
    Rob

  • Bapi for inbound delivery using PO

    Hi experts,
    I want to create a bapi for inbound delivery using PO.
    which bapi or FM should i use and can you send me the code for that.
    Thanks,
    Rajiv

    Hi Rajiv,
    Please check this FM --> BAPI_DELIVERYPROCESSING_EXEC
    Please check these threads
    Bapi to create inbound delivery
    BAPI to create inbound delivery
    Hope this would help you.
    Good luck
    Narin

  • Problem with HU during creation of Inbound Delivery using IDoc

    Hi,
    When I am creating Delivery manually and perform Packing, Handling Unit information is stored in VEKP and VEPO tables.
    But when I am processing through IDoc, after passing data to Handling Unit Segments E1EDL37 (Handling unit header), E1EDL39 (Control Segment for Handling Units), E1EDL44 (IDoc: Handling Unit Item - Delivery), It is creating delivery successfully but Handling Unit information is not getting stored in VEKP, VEPO tables.
    Tried most of the notes 912470, 678464, 682506 and all of them say "<i>You use the Idoc DESADV to create inbound delivery with packing data. The delivery is created, Idoc gets status 52 but the Handling Units (HUs) are missing. This is due to a program error. In case the IDoc contains segments to create HUs (E1EDL37), the IDoc processing should end in error status (51) as long as no packing data could be created</i>.".
    Need your advice whether we have to maintain any customizing for this or how to proceed with it.
    Thanks in advance,
    Murali.

    IDocs and BAPIs sometimes behave differently than transactions. You might need to add a user exit specifically for IDoc processing. Otherwise send a message to SAP and have them look at it.

  • PGR error at Inbound delivery

    Hi Guys
    I have one inbound delivery and When I do PGR
    It is giving Error :PL Stock in transit exceeded by (10 quantity)
    In good movemnet tab Movement  type is 901
    Please provide your suggestion
    Thanks in advance
    SAP MM

    Hi,
    Please check the stock for the material and batch if you use batch.
    It seems the available stock is less.
    Thanks,
    Venkat

  • Trigger internal serial nos creation for inbound delivery using DELVRY03

    Hi all,
    I am working in ECC 6.0 I need to update serial nos in the inbound delivery. The internal serial nos. that will be generated by the system, I have to trap them for a given delivery and map it to a set of external serial nos.(length is 40 chars) and update in a Z table.
    For changing the delivery, I am using idoc DELVRY03 (message SHPCON). Within the idoc I am not able to find any such field which will trigger the automatic creation of internal serial nos. In case of idoc MBGMCR03 (goods movement), there is a field E1BP2017_GM_ITEM_CREATE-SERIALNO_AUTO_NUMBERASSIGNMENT which when set to 'X', the internal serial nos are automatically generated and can be found in table SER03.
    I want a similar thing for the DELVRY03 idoc. Can anyone help me on this?
    If not possible through Idoc, then whats the other option?
    My aim is to just get the internal serial nos created through delivery change activity.
    Note - The serial no. profile cannot have the option of serial no. usage set to '04 - automatic' in SPRO as per the client's business process.
    Thanks,
    Shoma

    Hi Shoma,
    copy the FM  which is assigned to your processcode and copy to ZFM and write your modifications on that ZFM.
    It will resolves your problem.
    Regards,
    Venkat.

  • Post Goods Receipt for Inbound Delivery using WHSCON IDoc

    Dear All
    Currently I am working on a big project dealing with EDI connections to our logistics partner for the Export business. The entire message flow between Lindt and our partner should be via EDI. Our SAP release is (still) 4.6c.
    We will create two kinds of despatch advice messages, one for inbound deliveries and one for outbound deliveries for customers.
    I would appreciate your support in the following problem that I am facing with the inbound delivery scenario:
    We create stock transport orders (purchase orders, POs) for the goods intended to be delivered into the plant at our partner
    We create a delivery (type NL = replenishment delivery) for this POs
    As soon as we post the goods issue we send the despatch advice (as EANCOM D96A DESADV message) to our partner.
    At this point the delivery is basically completed, i.e. packing status (PS) and goods movement status (GM / GS) are equal to 'C' (= completed).
    Our logistics partner uses the same EDI message to send us the goods receipts data, e.g.:
    We dispatched 50 units of a product => QTY:50:12
    The partner received indeed 50 units => QVR:50:66
    Please note that we do not use the QVR segment for the quantity difference (between despatched and received quantity) but it contains the received units. This way we avoid negative values in the QVR segment.
    When the logistics partner sends back the DESADV message containing the received quantities (QVR segment) we want to make
    the goods receipts for the products in the original stock transport order and
    upate the message flow in the delivery
    My idea was to transform the incoming DESADV message into a WHSCON.DELVRY03 IDoc based on the documentation in: [Delivery Interface|http://help.sap.com/saphelp_crm40/helpdata/en/e2/654b15a9f411d184ec0000e81ddea0/content.htm]
    In the delivery header control E1EDL18 I used QUALF = 'PGI' (Post goods issue).
    I prepared an inbound WHSCON IDoc according to the documentation mentioned below. I managed to get some feedback from the Idoc processing implying that the system tried to do the goods receipt in the PO but failed.
    To make a long story short here are my questions:
    Can an inbound WHSCON IDoc used for doing both the goods receipt in the PO and the update of the message flow in the delivery?
    Does anybody have an example on how to fill the WHSCON IDoc?
    Or is my approach a cul-de-sac ?
    Kind Regards
       Uwe
    PS: A related question can be found here: Goods Receipt in PO AND Message Flow Update in Inb. Delivery using WMMBXY

    Hi Uwe,
    Can an inbound WHSCON IDoc used for doing both the goods receipt in the PO and the update of the message flow in the delivery?
    The binary answer would be no. You should use WMMBXY or MBGMCR instead.
    But if we are doing goods receipt against Inbound delivery then answer is YES with additionally E1EDL18-QUALF = 'PIC' populated. But please remember no partial receipt is possible against Inbound Delivery.
    We should populate E1EDL20-VBELN with our Inbound delivery number and line item info should go to E1EDL24.
    I have done a similar interface recently where we are doing receipt against Inbound delivery. But our case was a bit complex because we had to support against Inbound delivery. So we had to go for a custom solution on top of IDOC_INPUT_DELVRY.
    Hope this helps. Let me know if you have more questions.
    Regards,
    Rudra

  • Goods receipt inbound delivery using old goods movement transactions

    Hi! I have a client who is still using the old goods movement transactions in the new ECC system. I would like to confirm whether it is possible at all to receipt inbound delivery (from shipping notification) using any of the old goods movement transactions? I don't seem to be able to find one that work.
    Cheers!
    SF

    Yes, does anyone have any idea re this?
    Cheers!
    SF

  • Inbound Delivery Using ASN in SRM

    Dear All,
    We are implementing SRM to our Business,our SAP is running on 4.7C. We have done the BBP in which we got the following queries regarding Inbound delivery generation in SAP for PO.
    -->>> We have activated the confirmation Key in Po, so with this we can able to send the Po's to Vendor portal.
    --->>> Now after receiving all vendor has created ASN(Advance shipping Notification), once he created ASN in SAP automatically an inbound delivery should need to create.
    Is there any BAPI/Function Module available in SAP 4.7C, in which system will Pull the required field of ASN to create GR.
    I heard this can be done by using IDOC, but we want only through BAPI/FM.
    Please let me know is there any way we can have BAPI/FM available in SAP or should we require to customize??
    Regards,
    Nagaraj S

    Dear Nagaraj
    Standard Process flow :
    1. PO created with confirmations and sent to Vendor
    2. Vendor sends ASN.
    3. Inbound dlivery will be created wrt ASN in SAP
    4. Goods receipt wrt inbound delivery in SAP 
    For creating the inbound delivery wrt ASN, you can use BBP_INB_DELIVERY_CREATE .
    For creating the Goods recept , you can use BAPI_GOODSMVT_CREATE
    More info please refer :
    http://www.sap-img.com/abap/bapi-goodsmvt-create-to-post-goods-movement.htm
    warm regards
    Ramakrishna

  • How to create Inbound Delivery using SHPMNT03 Idoc details...

    Hi,
         I need to create <b><b>Inbound delivery</b> using idoc SHPMNT03</b> details. I am getting all the data required to create Inbound delivery is from this idoc. for that I need to create a custom function module.
    I tried with FM  IDOC_INPUT_DESADV1. But it is for only if you use DELVRY03.
    I haven't (yet) found a way to create automatically an inbound delivery when you post the goods issue from the outbound delivery.
    Does anyone experienced the use of inbound deliveries with STO and what are your recommendation?
    Thanks a lot,
    Ranjith.

    Hi there,
    Please have a look at the following link.
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/dc/6b828943d711d1893e0000e8323c4f/frameset.htm
    Hope this helps,
    Kind Regards,
    Matthew

  • Create a Batch split for inbound delivery using IDOC

    Hi,
    I have an requirement to create Batch splits in the Inbound delivery.
    These Inbound deliveries are created using IDOC.
    So when the inbound deliveries are created through IDOC the Batch split is not happening.
    How can i achieve this through Coding?
    Any pointers on this will be highly appreciated.

    Hi ,
    Try this link.
    http://wiki.sdn.sap.com/wiki/display/ABAP/Toapplybatchsplitinanoutbound+delivery
    Regards
    HM

  • Error during inbound delivery creation for some times not always

    Hi,
    I'm getting the following error when i'm trying to create an inbound delivery for PO.
                                                                                    Diagnosis                                                                               
    The system attempted to find the reference movement type for         
         the Warehouse Management system. A corresponding entry is            
         missing in table 156S with the argument 101/X/X/ / /X/.              
         The argument consists of:                                            
         o   IM movement type                                                 
         o   Indicator: Value update                                          
         o   Indicator: Quantity update                                       
         o   Special stock                                                    
         o   Movement indicator                                               
         o   Access indicator                                                 
         o   Indicator: Consumption         
    Can someone help me to resolve it? as it is not happening always
    Appreciates everyone time and help.
    Thanks and regards,
    Siva

    Hi,
    Thanks for the response and yes i did maintained IM/WM mvt types for 101 in both places.
    If the movement type is maintained well why SAP says it is not?
    SPRO > LE > WM > Interfaces > IM > Define Movement Types - "Assign WM Movement Type References to IM Movement Types'
    Related tabel is V_156S_WM
    If you check your configuration you will see that there are many entries with 101, and there are several other parameters...
    First you should check what you are doing in IM, what parameters that mvt has (qty, value update, special stock, etc) > after that you should check whether it is maintained well in WM customizing - see steps in my previous email.
    Regards,
    Csaba

Maybe you are looking for