<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Trouble using BAPI_INB_DELIVERY_SAVEREPLICA in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/trouble-using-bapi-inb-delivery-savereplica/m-p/5256982#M1214359</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi people,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using BAPI_INB_DELIVERY_SAVEREPLICA to create inbound deliveries and handling units but can not get the bapi to work. I searched the forum but couldn't find any sample code how to use this bapi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my program I create a purchase order first using BAPI_PO_CREATE. Then I transfer the po-data to the next bapi and call it. It returns the message: &lt;SPAN __default_attr="Courier" __jive_macro_name="font"&gt;Error in document &amp;amp;1 item 10 (quantity consistency check)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I call the bapi like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
        ls_header_data-dlv_type = 'EL'.

        CLEAR lv_item_number.
        LOOP AT lt_po_items.
          ADD 10 TO lv_item_number.
          lt_item_data-itm_number = lv_item_number.
          lt_item_data-material = lt_po_items-pur_mat.
          READ TABLE lt_po_item_schedules INDEX sy-tabix.
          lt_item_data-dlv_qty = lt_po_item_schedules-quantity.
          lt_item_data-dlv_qty_stock = lt_po_item_schedules-quantity.
          lt_item_data-cum_btch_qty = 2.

          APPEND lt_item_data.

          lt_item_ref_purchase_order-itm_number = lv_item_number.
          lt_item_ref_purchase_order-doc_number = lv_po_number.
          lt_item_ref_purchase_order-itm_number_ref = lt_po_items-po_item.
          APPEND lt_item_ref_purchase_order.

          lt_handling_unit_header-hdl_unit_exid = '1'.
          APPEND lt_handling_unit_header.

          lt_handling_unit_item-hdl_unit_exid = '2'.
          APPEND lt_handling_unit_item.

        ENDLOOP.


        CLEAR lt_return2.

        CALL FUNCTION 'BAPI_INB_DELIVERY_SAVEREPLICA'
          EXPORTING
            header_data             = ls_header_data
            sender_system           = ls_sender_system
          IMPORTING
            delivery                = lv_delivery
          TABLES
            header_partner          = lt_header_partner
            header_deadlines        = lt_header_deadlines
            item_data               = lt_item_data
            item_org                = lt_item_org
            item_ref_purchase_order = lt_item_ref_purchase_order
            handling_unit_header    = lt_handling_unit_header
            handling_unit_item      = lt_handling_unit_item
            return                  = lt_return2.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know which data I need to provide to get the bapi to work?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ivo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Mar 2009 17:28:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-03-12T17:28:24Z</dc:date>
    <item>
      <title>Trouble using BAPI_INB_DELIVERY_SAVEREPLICA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/trouble-using-bapi-inb-delivery-savereplica/m-p/5256982#M1214359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi people,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using BAPI_INB_DELIVERY_SAVEREPLICA to create inbound deliveries and handling units but can not get the bapi to work. I searched the forum but couldn't find any sample code how to use this bapi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my program I create a purchase order first using BAPI_PO_CREATE. Then I transfer the po-data to the next bapi and call it. It returns the message: &lt;SPAN __default_attr="Courier" __jive_macro_name="font"&gt;Error in document &amp;amp;1 item 10 (quantity consistency check)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I call the bapi like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
        ls_header_data-dlv_type = 'EL'.

        CLEAR lv_item_number.
        LOOP AT lt_po_items.
          ADD 10 TO lv_item_number.
          lt_item_data-itm_number = lv_item_number.
          lt_item_data-material = lt_po_items-pur_mat.
          READ TABLE lt_po_item_schedules INDEX sy-tabix.
          lt_item_data-dlv_qty = lt_po_item_schedules-quantity.
          lt_item_data-dlv_qty_stock = lt_po_item_schedules-quantity.
          lt_item_data-cum_btch_qty = 2.

          APPEND lt_item_data.

          lt_item_ref_purchase_order-itm_number = lv_item_number.
          lt_item_ref_purchase_order-doc_number = lv_po_number.
          lt_item_ref_purchase_order-itm_number_ref = lt_po_items-po_item.
          APPEND lt_item_ref_purchase_order.

          lt_handling_unit_header-hdl_unit_exid = '1'.
          APPEND lt_handling_unit_header.

          lt_handling_unit_item-hdl_unit_exid = '2'.
          APPEND lt_handling_unit_item.

        ENDLOOP.


        CLEAR lt_return2.

        CALL FUNCTION 'BAPI_INB_DELIVERY_SAVEREPLICA'
          EXPORTING
            header_data             = ls_header_data
            sender_system           = ls_sender_system
          IMPORTING
            delivery                = lv_delivery
          TABLES
            header_partner          = lt_header_partner
            header_deadlines        = lt_header_deadlines
            item_data               = lt_item_data
            item_org                = lt_item_org
            item_ref_purchase_order = lt_item_ref_purchase_order
            handling_unit_header    = lt_handling_unit_header
            handling_unit_item      = lt_handling_unit_item
            return                  = lt_return2.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know which data I need to provide to get the bapi to work?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ivo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2009 17:28:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/trouble-using-bapi-inb-delivery-savereplica/m-p/5256982#M1214359</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-12T17:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble using BAPI_INB_DELIVERY_SAVEREPLICA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/trouble-using-bapi-inb-delivery-savereplica/m-p/5256983#M1214360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems this BAPI can only be used for replication and not in our situation. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Solved this problem by using bdc call transaction for creating the delivery, BAPI_HU_CREATE for creation of the handling unit and bdc call transaction for packing the items on the handling unit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
PERFORM dynpro USING:
        'X'   'RM06EANL'        '1000',
        ' '   'BDC_CURSOR'      'P_TEST',
        ' '   'BDC_OKCODE'      '=ONLI',                     "OK code
        ' '   'S_EBELN-LOW'     p_po_number,
        ' '   'P_DATE'          lv_deliv_date,
        ' '   'P_TEST'          space.

  CALL TRANSACTION 'VL34' USING gt_bdc_tab MODE 'N' UPDATE 'S'
         MESSAGES INTO gt_messtab.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2009 12:45:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/trouble-using-bapi-inb-delivery-savereplica/m-p/5256983#M1214360</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-25T12:45:19Z</dc:date>
    </item>
  </channel>
</rss>

