<?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_SALESORDER_CREATEFROMDAT2 Updating condition value in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-salesorder-createfromdat2-updating-condition-value/m-p/12102384#M1972796</link>
    <description>&lt;P&gt;Solved it. The problem is caused by an existing user exit. We have added proper filters so that it is not triggered by our programs. &lt;/P&gt;</description>
    <pubDate>Mon, 21 Oct 2019 13:50:04 GMT</pubDate>
    <dc:creator>former_member577061</dc:creator>
    <dc:date>2019-10-21T13:50:04Z</dc:date>
    <item>
      <title>BAPI_SALESORDER_CREATEFROMDAT2 Updating condition value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-salesorder-createfromdat2-updating-condition-value/m-p/12102382#M1972794</link>
      <description>&lt;P&gt;Hi gurus,&lt;/P&gt;
  &lt;P&gt;I am working on an upload program which will mass create Sales Order. &lt;/P&gt;
  &lt;P&gt;A brief introduction as below:&lt;/P&gt;
  &lt;P&gt;1. Prices are all manually entered during upload.&lt;/P&gt;
  &lt;P&gt;2. Condition type (ZEAP) is configured to allow manual entries. &lt;/P&gt;
  &lt;P&gt;3. Manual creation via VA01 is working without any issue.&lt;/P&gt;
  &lt;P&gt;4. I am attempting to upload and create a sales order with multiple line items.&lt;/P&gt;
  &lt;P&gt;5. All line items have the same condition type (ZEAP) in upload file and before passing to bapi BAPI_SALESORDER_CREATEFROMDAT2.&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;My issue:&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;1. When upload a sales order with 3 line items, in the created sales order, the first two line items have their prices updated. &lt;STRONG&gt;&lt;U&gt;The third line is not updated&lt;/U&gt;&lt;/STRONG&gt;. &lt;/P&gt;
  &lt;P&gt;2. Issue only occurs when there are multiple line items and only occurs to the last line item. &lt;/P&gt;
  &lt;P&gt;&lt;U&gt;Kindly advise on what are the possible cause of errors and let me know the information is suffficient.&lt;/U&gt;&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;Code snippet:&lt;/STRONG&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;"Begin of line item condition details
    ls_cond-itm_number = lv_posnr.
    ls_cond-cond_type  = &amp;lt;fs_upload&amp;gt;-kschl.
    ls_cond-cond_value = &amp;lt;fs_upload&amp;gt;-kbetr.
    ls_cond-condvalue  = &amp;lt;fs_upload&amp;gt;-kbetr.
    ls_cond-cond_p_unt = &amp;lt;fs_upload&amp;gt;-kpein.
    ls_cond-currency   = &amp;lt;fs_upload&amp;gt;-waers.
    ls_cond-curr_iso   = &amp;lt;fs_upload&amp;gt;-waers.
    ls_cond-cond_unit  = &amp;lt;fs_upload&amp;gt;-kmein.
    ls_cond-cd_unt_iso = &amp;lt;fs_upload&amp;gt;-kmein.
    ls_cond-cond_st_no = '020'.
    ls_cond-cond_count = '01'.
    ls_cond-cond_updat = abap_true.

    ls_condx-itm_number = lv_posnr.
    ls_condx-cond_st_no = '020'.
    ls_condx-cond_count = '01'.
    ls_condx-cond_type  = &amp;lt;fs_upload&amp;gt;-kschl.
    ls_condx-cond_value = abap_true.
    ls_condx-cond_p_unt = abap_true.
    ls_condx-currency   = abap_true.
    ls_condx-cond_unit  = abap_true.
    ls_condx-updateflag = 'U'.

    APPEND ls_items     TO lt_items.
    APPEND ls_itemx     TO lt_itemx.
    APPEND ls_schedule  TO lt_schedule.
    APPEND ls_schedulex TO lt_schedulex.
    APPEND ls_cond      TO lt_cond.
    APPEND ls_condx     TO lt_condx.
  ENDLOOP.

  CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
    EXPORTING
      order_header_in      = ls_header
      order_header_inx     = ls_headerx
    IMPORTING
      salesdocument        = lv_vbeln
    TABLES
      return               = lt_return
      order_items_in       = lt_items
      order_items_inx      = lt_itemx
      order_partners       = lt_partner
      order_schedules_in   = lt_schedule
      order_schedules_inx  = lt_schedulex
      order_conditions_in  = lt_cond
      order_conditions_inx = lt_condx.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 06 Oct 2019 10:09:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-salesorder-createfromdat2-updating-condition-value/m-p/12102382#M1972794</guid>
      <dc:creator>former_member577061</dc:creator>
      <dc:date>2019-10-06T10:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_SALESORDER_CREATEFROMDAT2 Updating condition value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-salesorder-createfromdat2-updating-condition-value/m-p/12102383#M1972795</link>
      <description>&lt;P&gt;It's an odd one but could be a variety of reasons. From the top of my head:&lt;/P&gt;&lt;P&gt;1) Is it always the last item? Check with 1 item and, say, 5 items. Use the same material in all items to make sure it's not material related. &lt;/P&gt;&lt;P&gt;2) Use the same data in VA01 and confirm it works - maybe there are other factors involve and this specific condition simply can't be entered for the specific item?&lt;/P&gt;&lt;P&gt;3) User exit gone wrong?&lt;/P&gt;&lt;P&gt;Don't see anything wrong in the code and I assume you've already checked the data before BAPI is called.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2019 22:14:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-salesorder-createfromdat2-updating-condition-value/m-p/12102383#M1972795</guid>
      <dc:creator>Jelena_Perfiljeva</dc:creator>
      <dc:date>2019-10-07T22:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_SALESORDER_CREATEFROMDAT2 Updating condition value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-salesorder-createfromdat2-updating-condition-value/m-p/12102384#M1972796</link>
      <description>&lt;P&gt;Solved it. The problem is caused by an existing user exit. We have added proper filters so that it is not triggered by our programs. &lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2019 13:50:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-salesorder-createfromdat2-updating-condition-value/m-p/12102384#M1972796</guid>
      <dc:creator>former_member577061</dc:creator>
      <dc:date>2019-10-21T13:50:04Z</dc:date>
    </item>
  </channel>
</rss>

