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

Similar Messages

  • How can delayed delivery update be configured for Inbound delivery ?

    Hi All,
    How can delayed delivery update be configured for Inbound delivery ?
    There is setting for Outbound delivery delayed delivery update but how the same functionality be used for Inbound delivery?
    Regards
    Jimmi

    Hello Jimmi,
    Unfortunately I must confirm that the Delayed delivery update is only available for outbound deliveries. Please see below note for further details
    664316 Tips for the delayed delivery update for TO
    I hope this information helps!
    Martin

  • Delivery Date in inbound delivery doc not accurate

    Dear all,
    I have a question with regards to the wrong delivery date appear in our inbound delivery.
    Our inbound delivery is created via a message output in the outbound delivery of a standard SAP cross company stock transport order. The delivery date in the inbound delivery is not correct from a business point of view.
    +The correct delivery date in the inbound delivery document should be [the Actual GI date field in the outbound delivery] + [transport time (i.e. route field) in the outbound delivery].+
    Either way (i.e. the Actual GI date field is later/earlier than the planned GI in the outbound delivery), the delivery date in the inbound delivery is also wrong.
    Do you have any idea? We have tried to change the inbound delivery type EL by setting a flag (i.e. X) in the rescheduling (TVLK-NEUTE), and it still doesnu2019t work.
    Please help.
    Thanks.
    Tuff

    implements SAP Note 1316614

  • Delivery Date in Inbound delivery document not correct

    Dear all,
    I have a question with regards to the wrong delivery date appear in our inbound delivery.
    Our inbound delivery is created via EDI output in the outbound delivery of a standard SAP cross company stock transport order. The delivery date in the inbound delivery is not correct from a business point of view.
    +The correct delivery date in the inbound delivery document should be [the Actual GI date field in the outbound delivery] + [transport time (i.e. route field) in the outbound delivery].+
    Either way (i.e. the Actual GI date field is later/earlier than the planned GI in the outbound delivery), the delivery date in the inbound delivery is also wrong.
    Do you have any idea?  We have tried to change the inbound delivery type EL by setting a flag (i.e. X) in the rescheduling (TVLK-NEUTE), and it still doesnu2019t work.
    Please help.
    Thanks.
    Tuff

    Does anyone know this problem?
    appreciate some feedback.

  • Delivery date in inbound delivery

    Hi
    WE have the following scenario
    WE create a inter-company STO.  Outbound delivery is created against STO and then we do PGI.
    Suppose planned delivery dt of OBD is 10-jan-2011 and actual PGI is done on 18-jan-2011.
    After PGI we create inbuound delivery in receiving plant.  In inbound delivery, we are getting delivery date as planned delivery date of outbound delivery i.e. 10-jan-2011.  But we want actual PGI date i.e. 18-jan-2011 in delivery date of inbound delivery.
    is it possible?  Please suggest how can we do this?

    Hi,
    I think the issue is not related to inbound delivery. Because you probably would not only have delivery date at inbound delivery equal to PGI date. Instead it should be PGI+transit time. Hence, I believe what you should focus is to get planned delivery date corrected at your outbound delivery during PGI.
    I do not think standard config supports rescheduling of planned dates at delivery during PGI (even if you setup rescheduling type 'A' at your delivery type). But you can always call SD_SCHEDULING FMs to get new delivery dates and get those posted from outbound to inbound deliveries.
    Regards,
    Dominik Modrzejewski

  • Different delivery type for inbound delivery

    Hi,
    Somebody knows if it is possible to assign diferent delivery types for inbound delivery from differents document type of PO?
    for example, delivery type EL for "NB" PO and delivery type "ZEL" for UB (Stock Transp. Order). 
    thanks
    RZ

    Dear,
    Check: Different inbound delivery types from PO conf control keys
    Regards,
    Syed Hussain.

  • 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.

  • Change in PO Qty. after Inbound Delivery.

    Hi,
    Suppose against a Purchase Order  an inbound delivery of 100 pc. is created(PO Order Qty. is also 100).
    Once a delivery is created,then Iam change the PO qty. from 100 to 80(System only throws an info message ME545,which I tried to convert it into error,but still it throws an info.).
    Why system is allowing me to change the PO qty?Kindly advise.

    system will allow changes for all PO qty untill and unless the item is bloced or deletion indicator is set. the system will not stop changes to qty even if you recieve full qty of material.
    the only way to stop is to make use os user exit as prescribed by Charlie
    vikrama

  • Update Receiving Site in Inbound Delivery

    Hello -
    I would like to know how i can update the Receiving Site (LIPS-UMWRK) for an Inbound Delivery.  This field appears in the tab Good Movement Tab.
    Thanks,

    Hi swathi,
    I am also having the same issue now. can you please tell me how you solved this issue.

  • ATP Check - Purchase Order Option Includes Qty on Inbound Delivery

    We are on ECC 6.0 and we recently turned on purchase orders in our ATP check (and turned off replenishment lead time).  We have PO's turned on just we can see the PO due date from the ATP proposal screen, not to actually confirm against that PO qty. 
    What we have found is that as soon as an inbound delivery is created for that PO, it considers that material to be available and automatically confirms the qty.  When you look at ATP quantities, the inbound delivery is showing as a shipping notification.  What's puzzling to me is that there is a totally seperate option in the checking rule for shipping notifications.
    We have found a temporary workaround, but I am just trying to understand if this is a bug or if this is the way that SAP intended for it to work... just so I know which way to pursue this.  Thanks.
    MM

    Hi,
    In T.code OVZ9, for your availability checking rule and Availability check combination, you need to select value X or A, in the field Incl. release order requirements.
    Regards,

  • VL32N Zero Receiving or Setting Delivery Complete on Inbound Delivery

    ERP Retail Scenario:
    We receive ASN from vendor creating inbound delivery; however, some items are not received so we enter zero quantity for them into VL32N
    Zero quantity does not post to article document and invoice verification process (GR-IV)cannot be done.
    1) Can delivery complete flag be enabled in VL32N (currently grayed out) so document flow proceeds as in MB01? We do not want to use MB transactions for EDI process.
    OR
    2) Can GR-IV process be set to ignore zero received items? Currently if we remove the flag from the PO, it works but we want to do it without removing this flag.
    Thanks in advance,

    Hi ,
    You can Crete VL32N without the available Quantity , I.e You can delete the Zeroed Qnty and Create a new Inbound for the rest . Hope it works.

  • PO delivery date vs Inbound delivery date

    Hi,
    I'm using message number M7-254 and set it as Error message. When I do GR w/ ref to inbound delivery the message M7-254 still considers/reads the PO del date instead of inbound del date during GR. Can it be modified to read the del date from inbound when there's inbound del created for the PO?
    Or if not, can you advise another system message that would best suit our customer's requirement where system blocks GR if posting date not equal inbound delivery date?
    Thanks in advance.

    Hi Marianne,
    A quick thought:
    Use the BADI - ME_PROCESS_PO_CUST & the method - PROCESS_SCHEDULE to copy the delivery date as per your inbound document to the field - Latest GR Date in Delivery tab of the Item details section.
    Then in OMCQ flag the message M7 163 message as E. This would ensure that the system will not allow GR to be done after this date.
    Hope the above helps.
    Regards,
    Vivek

  • Proposed delivery quantity in inbound delivery vs purchase schedule line

    Hello all
    I have got a doubt when creating inbound delivery for an item of purchase schedule line. I want to know how to get the proposed delivery quantity equal to the quantity of all schedule lines until today.
    For example I have got 4 schedule lines for a material and today is 28.10.2011
    20.10.2011 11ud
    28.10.2011 13ud
    03.11.2011 17ud
    05.11.2011 15ud
    when I execute VL31N with date = 28.10.2011, I want to proposed delivery quantity = 11+13 = 24ud.
    However, what I got is always the total quantity of all pending schedule lines = 111317+15=56ud.
    Do you know how can I achieve my propose?
    thank you in advance

    Hi Alan
    Thank you for your reply.
    In some cases (depending on vendor) we are using vendor ASN by EDI. In other cases (when there is no EDI conection with vendor) we use manually VL31N. So in these cases we need a proposed quantity by system in order to know if the quantity that we receive is coherent. Maybe we will try to implement the inbound delivery user exit.
    Thanks again!

  • Need help in updating Inco terms 1 and 2 in the Inbound delivery creation

    Hi Group,
    I have created an output type that will be triggered before an Inbound Delivery is created from the Outbound Delivery ( this scenario is in STO orders - Inter company stock transfer process ).
    I have copied a standard processing routine and customized it but, I am not able to update the 2 fileds (INCO1 and INCO2) in the item delivery of the Inbound Delivery. I was using the FM 'WS_DELIVERY_UPDATE' to update these 2 fields( by passsing the values fetched from the Outbound Delivery into the structure 'vbkok_wa' and the Inbound delivery created into the field 'delivery' of the FM ).
    When I run the the FM this is giving me errors and thus no Inbound Delivery is getting created.
    Please suggest me with some other way of updating these fields in the Inbound Delivery.
    and one more thing is that, I was selecting the Inco terms from the table LIKP directly, but this should not be the proper way to read the Incoterms, so please suggest me a way to read these 2 fields from the Outbound Delivery.
    to summarize, I need an FM to get the Incoterms from Outbound Delivery initially, and then, require another FM to update these Incoterms in the Inbound Delivery( this is a typical scenario in an STO - Stock Transport Order ).
    Please let me know your input on these 2 cases.
    Thanks for the help in advance.
    Regards
    Vishnu.

    Hi Group,
    By implementing the BADI 'LE_SHP_DELIVERY_PROC' this particular requirement can be fulfilled.
    Regards
    Vishnu.

  • BAPI_GOODSMVT_CREATE using inbound delivery with HU

    I have a program that uses BAPI_GOODSMVT_CREATE to GR Post the inbound delivery.  The inbound delivery is created thru ASN.  But I encounter error message BORGR 637 "Inbound delivery cannot be packed".  This error occurred because item packing status (VBUP-PKSTA) = 'C', the inbound delivery has HU items and is packed already.  This cannot be avoided because deliveries coming from the ASN is possible to have HUs already. Is there a workaround with this or maybe the parameters used are wrong or incomplete ?
      lv_grcode = '01'.
      MOVE: sy-datum TO ls_header-pstng_date,
            sy-datum TO ls_header-doc_date,
            sy-uname TO ls_header-pr_uname,
            likp-vbeln TO ls_header-ref_doc_no,
            '2' TO ls_header-ext_wms.
        MOVE: gt_lips-matnr   TO lt_item-material,
              gt_lips-werks   TO lt_item-plant,
              '101'           TO lt_item-move_type,
              gt_lips-lgort   TO lt_item-stge_loc,
              likp-lifnr      TO lt_item-vendor,
              gt_lips-n_lfimg TO lt_item-entry_qnt,
              gt_lips-meins   TO lt_item-entry_uom,
              gt_lips-vfdat   TO lt_item-expirydate,
              likp-vbeln      TO lt_item-deliv_numb_to_search,
              gt_lips-posnr   TO lt_item-deliv_item_to_search,
              'B'             TO lt_item-mvt_ind.
        APPEND lt_item.
    Thanks in advance

    Hello Giancarla,
    How you managed this situation, I mean, since you received no updates from this SCN topic how it was solved in your customer?
    I am also facing the same problem and I am doing research with correction notes, additional BAPIs and reversal engineering in BORGR transaction code to find out a way to enable GR for packed materials.
    Thanks in advance for your inputs.
    Regards,
    Luciano Ap. Souza

Maybe you are looking for

  • Can I download music onto one device from 2 different accounts?

    I have recently downloaded all my music from one account onto my ipod, but I also want my other music which is on a different account. The other account is for my iphone and want to keep the 2 seperate accounts. If I log out of the account I'm curren

  • ITunes Home Sharing not loading over VPN after upgrade to 10.10.2

    Hey, all. For years I have used a VPN to stream my iTunes library from my home computer to my work computer (who wants to bring a drive around with them everywhere?).  It works flawless on 10.8.5... Ever since I upgraded to 10.10.2 on my Mac Mini, th

  • Access InputText Value in Declarative Component

    Hi, I have created a declarative component that contains an inputText component: <af:inputText label="#{attrs.ucitLabelText}" id="dc_it1" contentStyle="text-transform:uppercase;" converter="StringAsUppercase"/> When I use the declarative component on

  • Difficulty positioning drop zone images

    I have carefully and repeatedly read the sizing and positioning instructions for images in iDVD drop zones. I am just not "getting it". There must be more info. somewhere about putting predictability into this process. The photo does not appear in th

  • Title Box sticks until quit

    iPhoto '08 (version 7.1.5 (378)) on a PPC (1.6 Ghz Dual G4 with 1.38 GB RAM) OS 10.4.11 When you're in iPhoto viewing "all photos" as opposed to viewing as Events, you get a large grey transparent box in the middle of the window which contains the da