<?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 sample Bapi code for creating orders in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sample-bapi-code-for-creating-orders/m-p/1287608#M154377</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI all,&lt;/P&gt;&lt;P&gt;ive been working on creating an order using idoc_input_orders and couldnt do it because of 2 fields. now changed my decission and thinking of writing a bapi to do the same. has anybody got the sample code for mapping and filling in the bapis before calling bapi for creating an order. Could somebody help me with a sample code and i could use it as a reference before starting coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Mar 2006 12:04:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-03-17T12:04:25Z</dc:date>
    <item>
      <title>sample Bapi code for creating orders</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sample-bapi-code-for-creating-orders/m-p/1287608#M154377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI all,&lt;/P&gt;&lt;P&gt;ive been working on creating an order using idoc_input_orders and couldnt do it because of 2 fields. now changed my decission and thinking of writing a bapi to do the same. has anybody got the sample code for mapping and filling in the bapis before calling bapi for creating an order. Could somebody help me with a sample code and i could use it as a reference before starting coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2006 12:04:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sample-bapi-code-for-creating-orders/m-p/1287608#M154377</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-17T12:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: sample Bapi code for creating orders</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sample-bapi-code-for-creating-orders/m-p/1287609#M154378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See if this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        one order with total sum of effort&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          clear:   l_order_header,&lt;/P&gt;&lt;P&gt;                   l_salesdocument,&lt;/P&gt;&lt;P&gt;                   l_order_partners,&lt;/P&gt;&lt;P&gt;                   l_order_items,&lt;/P&gt;&lt;P&gt;                   l_order_schdl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          refresh: it_order_items,&lt;/P&gt;&lt;P&gt;                   it_order_partners,&lt;/P&gt;&lt;P&gt;                   it_order_schdl,&lt;/P&gt;&lt;P&gt;                   it_return.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;???????? get from material ...&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        Order header&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          l_order_header-doc_type          = 'ZQBV'.&lt;/P&gt;&lt;P&gt;          l_order_header-distr_chan        = '10'.&lt;/P&gt;&lt;P&gt;          l_order_header-division          = '00'.&lt;/P&gt;&lt;P&gt;          if g_qals-werk eq '1100'.&lt;/P&gt;&lt;P&gt;            l_order_header-sales_org         = '1000'.&lt;/P&gt;&lt;P&gt;          else.&lt;/P&gt;&lt;P&gt;            if g_qals-werk eq '3100'.&lt;/P&gt;&lt;P&gt;              l_order_header-sales_org         = '3000'.&lt;/P&gt;&lt;P&gt;            else.&lt;/P&gt;&lt;P&gt;              message i001(00) with text-005.&lt;/P&gt;&lt;P&gt;            endif.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          l_order_header-purch_no_c        = g_qals-prueflos.  " &amp;lt;= lot&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        Partner data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          l_order_partners-partn_role      = 'AG'.&lt;/P&gt;&lt;P&gt;          l_order_partners-partn_numb      = g_qals-kunnr.&lt;/P&gt;&lt;P&gt;          append l_order_partners to it_order_partners.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        Order items =&amp;gt; only one&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          l_order_items-itm_number         = 10.&lt;/P&gt;&lt;P&gt;          l_order_items-material           = g_qals-matnr.&lt;/P&gt;&lt;P&gt;          l_order_items-target_qty         = 1.&lt;/P&gt;&lt;P&gt;          append l_order_items to it_order_items.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        Schedules for quantity&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          l_order_schdl-itm_number         = 10.&lt;/P&gt;&lt;P&gt;          l_order_schdl-req_qty            = 1.        " &amp;lt;=  only 1 !&lt;/P&gt;&lt;P&gt;          append l_order_schdl to it_order_schdl.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        Conditions for value&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          l_order_conditions-itm_number    = 10.&lt;/P&gt;&lt;P&gt;          l_order_conditions-cond_type     = 'PR00'.&lt;/P&gt;&lt;P&gt;          l_order_conditions-cond_value    = g_effort_sum.&lt;/P&gt;&lt;P&gt;          l_order_conditions-currency      = g_effort_unit.&lt;/P&gt;&lt;P&gt;          append l_order_conditions to it_order_conditions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        BAPI to create sales order&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'&lt;/P&gt;&lt;P&gt;            EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           SALESDOCUMENTIN               =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;              ORDER_HEADER_IN               = l_order_header&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           ORDER_HEADER_INX              =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           SENDER                        =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           BINARY_RELATIONSHIPTYPE       =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           INT_NUMBER_ASSIGNMENT         =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           BEHAVE_WHEN_ERROR             =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           LOGIC_SWITCH                  =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           TESTRUN                       =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           CONVERT                       = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            IMPORTING&lt;/P&gt;&lt;P&gt;              SALESDOCUMENT                 = l_salesdocument&lt;/P&gt;&lt;P&gt;            TABLES&lt;/P&gt;&lt;P&gt;              RETURN                        = it_return&lt;/P&gt;&lt;P&gt;              ORDER_ITEMS_IN                = it_order_items&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           ORDER_ITEMS_INX               =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;              ORDER_PARTNERS                = it_order_partners&lt;/P&gt;&lt;P&gt;              ORDER_SCHEDULES_IN            = it_order_schdl&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           ORDER_SCHEDULES_INX           =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;              ORDER_CONDITIONS_IN           = it_order_conditions&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           ORDER_CONDITIONS_INX          =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           ORDER_CFGS_REF                =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           ORDER_CFGS_INST               =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           ORDER_CFGS_PART_OF            =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           ORDER_CFGS_VALUE              =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           ORDER_CFGS_BLOB               =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           ORDER_CFGS_VK                 =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           ORDER_CFGS_REFINST            =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           ORDER_CCARD                   =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           ORDER_TEXT                    =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           ORDER_KEYS                    =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           EXTENSIONIN                   =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           PARTNERADDRESSES              =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                    .&lt;/P&gt;&lt;P&gt;          if not l_salesdocument is initial.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          order successfully created&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            message i001(00) with text-001 l_salesdocument.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2006 12:08:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sample-bapi-code-for-creating-orders/m-p/1287609#M154378</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-17T12:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: sample Bapi code for creating orders</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sample-bapi-code-for-creating-orders/m-p/1287610#M154379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will start coding. might ask for some help if i get stuck somewhere.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2006 12:09:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sample-bapi-code-for-creating-orders/m-p/1287610#M154379</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-17T12:09:39Z</dc:date>
    </item>
  </channel>
</rss>

