<?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 Re: Create Sales Order With Reference to Billing Document Using  BAPI_SALESORDER_CREATEFROMDAT2 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-sales-order-with-reference-to-billing-document-using-bapi-salesorder/m-p/519937#M18601</link>
    <description>&lt;P&gt;Have you tried debugging? Does the document exist with this number (leading zeroes?)? Are you passing the right document category?&lt;/P&gt;
  &lt;P&gt;As a side note, it's rather unusual to create a sales order with reference to a billing document, unless it's a return/credit. Regular sales orders are usually created with reference to other sales documents.&lt;/P&gt;</description>
    <pubDate>Mon, 18 Dec 2017 20:32:10 GMT</pubDate>
    <dc:creator>Jelena_Perfiljeva</dc:creator>
    <dc:date>2017-12-18T20:32:10Z</dc:date>
    <item>
      <title>Create Sales Order With Reference to Billing Document Using  BAPI_SALESORDER_CREATEFROMDAT2</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-sales-order-with-reference-to-billing-document-using-bapi-salesorder/m-p/519935#M18599</link>
      <description>&lt;P&gt;hi team,&lt;/P&gt;
  &lt;P&gt;i have a small issue while using the BAPI to generate a sales order with reference to billing document.but i getting a error message as below &lt;/P&gt;
  &lt;P&gt;SD document &lt;STRONG&gt;90000182&lt;/STRONG&gt; is not in the database or has been archived.Below is the small piece of code that i have included.any valuable suggestion is helpful.&lt;/P&gt;
  &lt;P&gt;wa_order_header_in-doc_type = 'ZITF'."""PASSING HEADER DETAILS&lt;BR /&gt; wa_order_header_in-sales_org = 'IN'.&lt;BR /&gt; wa_order_header_in-distr_chan = '10'.&lt;BR /&gt; wa_order_header_in-division = '02'.&lt;BR /&gt; wa_order_header_in-ref_doc = lv_bdoc.&lt;BR /&gt; select single fktyp from vbrk into fktyp where vbeln = lv_bdoc.&lt;BR /&gt; wa_order_header_in-refdoc_cat = fktyp..&lt;BR /&gt; &lt;BR /&gt; wa_order_header_inx-doc_type = 'X'.&lt;BR /&gt; wa_order_header_inx-sales_org = 'X'.&lt;BR /&gt; wa_order_header_inx-distr_chan = 'X'.&lt;BR /&gt; wa_order_header_inx-division = 'X'.&lt;BR /&gt; wa_order_header_inx-ref_doc = 'X'.&lt;BR /&gt; wa_order_header_inx-refdoc_cat = 'X'.&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; clear: lv_item,wa_order_items_inx-ref_doc_ca,wa_final3,wa_final.&lt;BR /&gt; &lt;BR /&gt; loop at it_final3 into wa_final3. &lt;BR /&gt; &lt;BR /&gt;wa_order_items_in-itm_number = lv_item.&lt;BR /&gt; wa_order_items_in-material = wa_final3-matnr.&lt;BR /&gt; wa_order_items_in-ref_doc = lv_bdoc.&lt;BR /&gt; wa_order_items_in-currency = lv_waerk.&lt;BR /&gt; wa_order_items_in-ref_doc_ca where vbeln = 'G'.&lt;BR /&gt; &lt;BR /&gt; wa_order_items_inx-itm_number = lv_item.&lt;BR /&gt; wa_order_items_inx-material = 'X'.&lt;BR /&gt; wa_order_items_inx-ref_doc = 'X'.&lt;BR /&gt; wa_order_items_inx-ref_doc_ca = 'X'.&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt; append wa_order_items_in to it_order_items_in.&lt;BR /&gt; append wa_order_items_inx to it_order_items_inx.&lt;BR /&gt; clear: wa_order_items_in,wa_order_items_inx.&lt;BR /&gt; &lt;BR /&gt; wa_order_conditions_in-cond_type = 'ZCPR'.&lt;BR /&gt; wa_order_conditions_in-cond_value = wa_final-rev_split.&lt;BR /&gt; wa_order_conditions_in-currency = lv_waerk.&lt;BR /&gt; &lt;BR /&gt; wa_order_conditions_inx-cond_type = 'X'.&lt;BR /&gt; wa_order_conditions_inx-cond_value = 'X'.&lt;BR /&gt; wa_order_conditions_inx-currency = 'X'.&lt;BR /&gt; &lt;BR /&gt; append wa_order_conditions_in to it_order_conditions_in.&lt;BR /&gt; append wa_order_conditions_inx to it_order_conditions_inx.&lt;BR /&gt; clear: wa_order_conditions_in,wa_order_conditions_inx.&lt;BR /&gt; &lt;BR /&gt; clear: wa_final3.&lt;BR /&gt; endloop.&lt;BR /&gt; &lt;BR /&gt; wa_bapiparnr-partn_role = 'WE'.""ship to party&lt;BR /&gt; wa_bapiparnr-partn_numb = EBG112.&lt;/P&gt;
  &lt;P&gt; call function 'CONVERSION_EXIT_ALPHA_INPUT'&lt;BR /&gt; exporting&lt;BR /&gt; input = wa_bapiparnr-partn_numb&lt;BR /&gt; importing&lt;BR /&gt; output = wa_bapiparnr-partn_numb.&lt;BR /&gt; append wa_bapiparnr to it_bapiparnr.&lt;BR /&gt; clear: wa_bapiparnr.&lt;BR /&gt; &lt;BR /&gt; wa_bapiparnr-partn_role = 'AG'."""sold to party&lt;BR /&gt;wa_bapiparnr-partn_numb = &lt;STRONG&gt;EBG112.&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt; call function 'CONVERSION_EXIT_ALPHA_INPUT'&lt;BR /&gt; exporting&lt;BR /&gt; input = wa_bapiparnr-partn_numb&lt;BR /&gt; importing&lt;BR /&gt; output = wa_bapiparnr-partn_numb.&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt; append wa_bapiparnr to it_bapiparnr.&lt;BR /&gt; clear: wa_bapiparnr.&lt;BR /&gt; &lt;BR /&gt; call function 'BAPI_SALESORDER_CREATEFROMDAT2'&lt;BR /&gt; exporting&lt;BR /&gt;order_header_in = wa_order_header_in&lt;BR /&gt; order_header_inx = wa_order_header_inx&lt;BR /&gt; importing&lt;BR /&gt; salesdocument = salesdocument&lt;BR /&gt; tables&lt;BR /&gt; return = it_return&lt;BR /&gt; order_items_in = it_order_items_in&lt;BR /&gt; order_items_inx = it_order_items_inx&lt;BR /&gt; order_partners = it_bapiparnr&lt;BR /&gt; * ORDER_SCHEDULES_IN =&lt;BR /&gt; * ORDER_SCHEDULES_INX =&lt;BR /&gt; order_conditions_in = it_order_conditions_in&lt;BR /&gt; order_conditions_inx = it_order_conditions_inx.&lt;/P&gt;
  &lt;P&gt;in it_return im getting an error message &lt;/P&gt;
  &lt;P&gt;SD document &lt;STRONG&gt;90000182&lt;/STRONG&gt; is not in the database or has been archived.&lt;/P&gt;
  &lt;P&gt;seniors could you please suggest me where i'm going wrong.&lt;/P&gt;
  &lt;P&gt;thanks in advance.&lt;/P&gt;
  &lt;P&gt;uday..,&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 15:54:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-sales-order-with-reference-to-billing-document-using-bapi-salesorder/m-p/519935#M18599</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-12-18T15:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Create Sales Order With Reference to Billing Document Using  BAPI_SALESORDER_CREATEFROMDAT2</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-sales-order-with-reference-to-billing-document-using-bapi-salesorder/m-p/519936#M18600</link>
      <description>&lt;P&gt;check the billing document in vf03 and their status to make sure they are existing document number.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 17:31:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-sales-order-with-reference-to-billing-document-using-bapi-salesorder/m-p/519936#M18600</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-12-18T17:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create Sales Order With Reference to Billing Document Using  BAPI_SALESORDER_CREATEFROMDAT2</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-sales-order-with-reference-to-billing-document-using-bapi-salesorder/m-p/519937#M18601</link>
      <description>&lt;P&gt;Have you tried debugging? Does the document exist with this number (leading zeroes?)? Are you passing the right document category?&lt;/P&gt;
  &lt;P&gt;As a side note, it's rather unusual to create a sales order with reference to a billing document, unless it's a return/credit. Regular sales orders are usually created with reference to other sales documents.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 20:32:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-sales-order-with-reference-to-billing-document-using-bapi-salesorder/m-p/519937#M18601</guid>
      <dc:creator>Jelena_Perfiljeva</dc:creator>
      <dc:date>2017-12-18T20:32:10Z</dc:date>
    </item>
  </channel>
</rss>

