<?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: bapi sales order in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-sales-order/m-p/2964283#M699420</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;     Are u using the BAPI with in the loop? make sure you clear the work area before you assign them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can create a flat file for item by adding more coloum in the flat file. This coloumn will help u in finding the sales order which it belongs to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Niyaz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Oct 2007 05:33:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-11T05:33:49Z</dc:date>
    <item>
      <title>bapi sales order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-sales-order/m-p/2964282#M699419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Respected Members&lt;/P&gt;&lt;P&gt; i am executing the Bapi for creating SALES ORDER and it is working fine.&lt;/P&gt;&lt;P&gt; but there are two problems .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First Problem:&lt;/P&gt;&lt;P&gt;  in my flat file i have two sales order &lt;/P&gt;&lt;P&gt;  sno  description quantity&lt;/P&gt;&lt;P&gt;  1      abc             50&lt;/P&gt;&lt;P&gt;  2      xyz              70&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i am executing the program two sales order are creating but thing is that for second sales order it is taking the quantity 50 only  that is of first order.&lt;/P&gt;&lt;P&gt;But when i debug the program it is taking 70 upto when it is calling the BAPI function module .&lt;/P&gt;&lt;P&gt;I am not getting where it is going back in bapi function module and taking the qunatity 50 for second sales order also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please give me your answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second thing is that suppose for sales order 1 i have five or six line items then how to make the flat file for this type of requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks give me your solutions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2007 05:31:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-sales-order/m-p/2964282#M699419</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-11T05:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: bapi sales order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-sales-order/m-p/2964283#M699420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;     Are u using the BAPI with in the loop? make sure you clear the work area before you assign them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can create a flat file for item by adding more coloum in the flat file. This coloumn will help u in finding the sales order which it belongs to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Niyaz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2007 05:33:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-sales-order/m-p/2964283#M699420</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-11T05:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: bapi sales order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-sales-order/m-p/2964284#M699421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;for multiple orders you have to run this BAPI in LOOP of the data table&lt;/P&gt;&lt;P&gt;and use BAPI_transaction_commit at the end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see the sample code and do it&lt;/P&gt;&lt;P&gt;SALES ORDER INPUT CREATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: p_auart TYPE auart OBLIGATORY.&lt;/P&gt;&lt;P&gt;PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.&lt;/P&gt;&lt;P&gt;PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.&lt;/P&gt;&lt;P&gt;PARAMETERS: p_spart TYPE vtweg OBLIGATORY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: p_sold TYPE kunnr OBLIGATORY.&lt;/P&gt;&lt;P&gt;PARAMETERS: p_ship TYPE kunnr OBLIGATORY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*ITEM&lt;/P&gt;&lt;P&gt;PARAMETERS: p_matnr TYPE matnr OBLIGATORY.&lt;/P&gt;&lt;P&gt;PARAMETERS: p_menge TYPE kwmeng OBLIGATORY.&lt;/P&gt;&lt;P&gt;PARAMETERS: p_plant TYPE werks_d OBLIGATORY.&lt;/P&gt;&lt;P&gt;PARAMETERS: p_itcat TYPE pstyv OBLIGATORY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DATA DECLARATIONS.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: v_vbeln LIKE vbak-vbeln.&lt;/P&gt;&lt;P&gt;DATA: header LIKE bapisdhead1.&lt;/P&gt;&lt;P&gt;DATA: headerx LIKE bapisdhead1x.&lt;/P&gt;&lt;P&gt;DATA: item LIKE bapisditem OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA: itemx LIKE bapisditemx OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA: partner LIKE bapipartnr OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA: return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA: lt_schedules_inx TYPE STANDARD TABLE OF bapischdlx&lt;/P&gt;&lt;P&gt;WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA: lt_schedules_in TYPE STANDARD TABLE OF bapischdl&lt;/P&gt;&lt;P&gt;WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;HEADER DATA&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;header-doc_type = p_auart.&lt;/P&gt;&lt;P&gt;headerx-doc_type = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;header-sales_org = p_vkorg.&lt;/P&gt;&lt;P&gt;headerx-sales_org = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;header-distr_chan = p_vtweg.&lt;/P&gt;&lt;P&gt;headerx-distr_chan = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;header-division = p_spart.&lt;/P&gt;&lt;P&gt;headerx-division = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;headerx-updateflag = 'I'.&lt;/P&gt;&lt;P&gt;&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;partner-partn_role = 'AG'.&lt;/P&gt;&lt;P&gt;partner-partn_numb = p_sold.&lt;/P&gt;&lt;P&gt;APPEND partner.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;partner-partn_role = 'WE'.&lt;/P&gt;&lt;P&gt;partner-partn_numb = p_ship.&lt;/P&gt;&lt;P&gt;APPEND partner.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ITEM DATA&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;itemx-updateflag = 'I'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;item-itm_number = '000010'.&lt;/P&gt;&lt;P&gt;itemx-itm_number = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;item-material = p_matnr.&lt;/P&gt;&lt;P&gt;itemx-material = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;item-plant = p_plant.&lt;/P&gt;&lt;P&gt;itemx-plant = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;item-target_qty = p_menge.&lt;/P&gt;&lt;P&gt;itemx-target_qty = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;item-target_qu = 'EA'.&lt;/P&gt;&lt;P&gt;itemx-target_qu = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;item-item_categ = p_itcat.&lt;/P&gt;&lt;P&gt;itemx-item_categ = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND item.&lt;/P&gt;&lt;P&gt;APPEND itemx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Fill schedule lines&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;lt_schedules_in-itm_number = '000010'.&lt;/P&gt;&lt;P&gt;lt_schedules_in-sched_line = '0001'.&lt;/P&gt;&lt;P&gt;lt_schedules_in-req_qty = p_menge.&lt;/P&gt;&lt;P&gt;APPEND lt_schedules_in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Fill schedule line flags&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;lt_schedules_inx-itm_number = '000010'.&lt;/P&gt;&lt;P&gt;lt_schedules_inx-sched_line = '0001'.&lt;/P&gt;&lt;P&gt;lt_schedules_inx-updateflag = 'X'.&lt;/P&gt;&lt;P&gt;lt_schedules_inx-req_qty = 'X'.&lt;/P&gt;&lt;P&gt;APPEND lt_schedules_inx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Call the BAPI&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;sales_header_in = header&lt;/P&gt;&lt;P&gt;sales_header_inx = headerx&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;salesdocument_ex = v_vbeln&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;return = return&lt;/P&gt;&lt;P&gt;sales_items_in = item&lt;/P&gt;&lt;P&gt;sales_items_inx = itemx&lt;/P&gt;&lt;P&gt;sales_schedules_in = lt_schedules_in&lt;/P&gt;&lt;P&gt;sales_schedules_inx = lt_schedules_inx&lt;/P&gt;&lt;P&gt;sales_partners = partner.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check the return table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;LOOP AT return WHERE type = 'E' OR type = 'A'.&lt;/P&gt;&lt;P&gt;EXIT.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: / 'Error in creating document'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COMMIT WORK AND WAIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: / 'Document ', v_vbeln, ' created'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2007 05:36:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-sales-order/m-p/2964284#M699421</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-11T05:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: bapi sales order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-sales-order/m-p/2964285#M699422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Respected Members&lt;/P&gt;&lt;P&gt;i have a problem in creating sales order through BAPI&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i will explain you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My flat file structure is &lt;/P&gt;&lt;P&gt;doc_type sales_org dis_Ch division part_num pono itm_num material short_text qty plant price&lt;/P&gt;&lt;P&gt;OR  1000 20 10 1000 123 10 100-100 abc 50 1000 500&lt;/P&gt;&lt;P&gt;OR  1000 20 10 1000  254 10 100-200 XYZ 70 1000 800&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now when i am executing my program with this flat file data , everything is coming but problem is that in second sales order which is getting create is also having the quantity and price value of the first sales order ie 50 and 500 and it is not taking quantity as 70 and price as 800.&lt;/P&gt;&lt;P&gt;Rest everything is getting changed .&lt;/P&gt;&lt;P&gt;For eg Material is getting changed and description is getting changed for second po.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for second sales order it is taking material 100-200 and description XYZ only.&lt;/P&gt;&lt;P&gt;Then why it is taking values for quantity and price same as first sales order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i m using the bapi function module in the loop only and thats why two sales order are getting generated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also at the debugging when the values are passed to BAPI function module it is passing the correct values ie 70 and 800 but finally when i am going to tcode VA02 and seeing the sales order then it is showing the values of the previous order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please give me the solution as soon as possible.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2007 10:54:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-sales-order/m-p/2964285#M699422</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-12T10:54:18Z</dc:date>
    </item>
  </channel>
</rss>

