<?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_CHANGE in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-salesorder-change/m-p/2858785#M670323</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sam&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simply remove the following line of coding:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT I_ORDERS.
"  i_orderheaderin-price_date = i_orders-prsdt.
append i_orderheaderin.
i_orderheaderinx-updateflag = 'U'.
"  i_orderheaderinx-price_date = 'X'.  " Do not mark this flag !!!
append i_orderheaderinx.
i_ORDERITEMIN-ITM_NUMBER = I_ORDERS-POSNR.
i_orderitemin-price_date = i_orders-prsdt.
APPEND i_ORDERITEMIN.
i_ORDERITEMINX-ITM_NUMBER = I_ORDERS-POSNR.
i_ORDERITEMINX-UPDATEFLAG = 'U'.
i_orderiteminx-price_date = 'X'.
APPEND i_ORDERITEMINX.
...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume that changing the price date in the header interferes with changing at the item level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Oct 2007 20:46:23 GMT</pubDate>
    <dc:creator>uwe_schieferstein</dc:creator>
    <dc:date>2007-10-01T20:46:23Z</dc:date>
    <item>
      <title>BAPI_SALESORDER_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-salesorder-change/m-p/2858782#M670320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using 'BAPI_SALESORDER_CHANGE' to change the 'Pricing Date' of an SD.&lt;/P&gt;&lt;P&gt;The intention is to change the 'Pricing Date'(PRSDT) of a &amp;lt;b&amp;gt;particular Line Item&amp;lt;/b&amp;gt;.  But the program is changing the 'Pricing Date' at the Header Level. I am not able to figure out what went wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you correct me?&lt;/P&gt;&lt;P&gt;Thanks a lot for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZVTEST1 NO STANDARD PAGE HEADING&lt;/P&gt;&lt;P&gt;                LINE-SIZE 132&lt;/P&gt;&lt;P&gt;                LINE-COUNT 65&lt;/P&gt;&lt;P&gt;                MESSAGE-ID ZM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: vbak, vbap, vbkd.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: v_records TYPE I.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF I_ORDERS OCCURS 0,&lt;/P&gt;&lt;P&gt;       VBELN LIKE VBAK-VBELN,&lt;/P&gt;&lt;P&gt;       POSNR LIKE VBAP-POSNR,&lt;/P&gt;&lt;P&gt;       prsdt like vbkd-prsdt,&lt;/P&gt;&lt;P&gt;      END OF I_ORDERS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of i_ORDERHEADERINX occurs 0.&lt;/P&gt;&lt;P&gt;        include structure bapisdh1x.&lt;/P&gt;&lt;P&gt;data: end of i_orderheaderinx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of i_ORDERHEADERIN occurs 0.&lt;/P&gt;&lt;P&gt;        include structure bapisdh1.&lt;/P&gt;&lt;P&gt;data: end of i_orderheaderin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF i_ORDERITEMIN OCCURS 0.&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE BAPISDITM.&lt;/P&gt;&lt;P&gt;DATA: END OF i_ORDERITEMIN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF i_ORDERITEMINX OCCURS 0.&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE BAPISDITMX.&lt;/P&gt;&lt;P&gt;DATA: END OF i_ORDERITEMINX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF i_RETURN OCCURS 0.&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE BAPIRET2.&lt;/P&gt;&lt;P&gt;DATA: END OF i_RETURN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF i_BAPIRETURN OCCURS 0.&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE BAPIRET2.&lt;/P&gt;&lt;P&gt;DATA: END OF i_BAPIRETURN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-- Selection Screen&lt;/P&gt;&lt;P&gt;select-options: s_vbeln for vbak-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters: p_posnr like vbap-posnr,&lt;/P&gt;&lt;P&gt;            p_date like vbkd-prsdt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-- Start-of-selection&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   select vbeln posnr prsdt from vbkd&lt;/P&gt;&lt;P&gt;           into table i_orders&lt;/P&gt;&lt;P&gt;          where vbeln in s_vbeln&lt;/P&gt;&lt;P&gt;            and posnr = p_posnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;     loop at i_orders.&lt;/P&gt;&lt;P&gt;       i_orders-prsdt = p_date.&lt;/P&gt;&lt;P&gt;       modify i_orders index sy-tabix.&lt;/P&gt;&lt;P&gt;     endloop.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-- Sort and remove duplicates from i_orders&lt;/P&gt;&lt;P&gt;  SORT I_ORDERS BY VBELN POSNR.&lt;/P&gt;&lt;P&gt;  DELETE ADJACENT DUPLICATES FROM I_ORDERS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-- Populate Bapi and Run Bapi Data&lt;/P&gt;&lt;P&gt;  CLEAR: i_orderheaderinx, i_orderitemin, i_orderiteminx,&lt;/P&gt;&lt;P&gt;  i_return, i_bapireturn, i_orders.&lt;/P&gt;&lt;P&gt;  REFRESH: i_orderitemin, i_orderiteminx, i_return, i_bapireturn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT I_ORDERS.&lt;/P&gt;&lt;P&gt;    i_orderheaderin-price_date = i_orders-prsdt.&lt;/P&gt;&lt;P&gt;    append i_orderheaderin.&lt;/P&gt;&lt;P&gt;    i_orderheaderinx-updateflag  = 'U'.&lt;/P&gt;&lt;P&gt;    i_orderheaderinx-price_date  = 'X'.&lt;/P&gt;&lt;P&gt;    append i_orderheaderinx.&lt;/P&gt;&lt;P&gt;    i_ORDERITEMIN-ITM_NUMBER = I_ORDERS-POSNR.&lt;/P&gt;&lt;P&gt;    i_orderitemin-price_date = i_orders-prsdt.&lt;/P&gt;&lt;P&gt;    APPEND i_ORDERITEMIN.&lt;/P&gt;&lt;P&gt;    i_ORDERITEMINX-ITM_NUMBER = I_ORDERS-POSNR.&lt;/P&gt;&lt;P&gt;    i_ORDERITEMINX-UPDATEFLAG = 'U'.&lt;/P&gt;&lt;P&gt;    i_orderiteminx-price_date = 'X'.&lt;/P&gt;&lt;P&gt;    APPEND i_ORDERITEMINX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF NOT i_orderitemin IS INITIAL.&lt;/P&gt;&lt;P&gt;    v_records = v_records + 1.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'&lt;/P&gt;&lt;P&gt;         EXPORTING&lt;/P&gt;&lt;P&gt;              SALESDOCUMENT    = I_ORDERS-VBELN&lt;/P&gt;&lt;P&gt;              ORDER_HEADER_IN  = i_orderheaderin&lt;/P&gt;&lt;P&gt;              ORDER_HEADER_INX = i_orderheaderinx&lt;/P&gt;&lt;P&gt;         TABLES&lt;/P&gt;&lt;P&gt;              RETURN           = i_return&lt;/P&gt;&lt;P&gt;              ORDER_ITEM_IN    = i_orderitemin&lt;/P&gt;&lt;P&gt;              ORDER_ITEM_INX   = i_orderiteminx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;         EXPORTING&lt;/P&gt;&lt;P&gt;              WAIT   = 'X'&lt;/P&gt;&lt;P&gt;         IMPORTING&lt;/P&gt;&lt;P&gt;              RETURN = i_bapireturn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  clear: i_orders.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-- Write out return&lt;/P&gt;&lt;P&gt;    LOOP AT i_return.&lt;/P&gt;&lt;P&gt;      WRITE: / i_return.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;    WRITE: / i_bapireturn.&lt;/P&gt;&lt;P&gt;    SKIP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-- Write out record count from file&lt;/P&gt;&lt;P&gt;  WRITE: / 'RECORD COUNT OF ORDERS TO CHANGE ', v_records.&lt;/P&gt;&lt;P&gt;  SKIP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2007 17:00:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-salesorder-change/m-p/2858782#M670320</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-01T17:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_SALESORDER_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-salesorder-change/m-p/2858783#M670321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sam&lt;/P&gt;&lt;P&gt;Pls refresh the following internal tables after the transaction commit&lt;/P&gt;&lt;P&gt; i_orderheaderin, i_orderheaderinx, i_return, i_orderitemin, i_orderiteminx.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Madhan Doraikannan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2007 17:08:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-salesorder-change/m-p/2858783#M670321</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-01T17:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_SALESORDER_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-salesorder-change/m-p/2858784#M670322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Madhan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did the change. But still it's not working. Thanks for your help though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2007 17:21:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-salesorder-change/m-p/2858784#M670322</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-01T17:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_SALESORDER_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-salesorder-change/m-p/2858785#M670323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sam&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simply remove the following line of coding:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT I_ORDERS.
"  i_orderheaderin-price_date = i_orders-prsdt.
append i_orderheaderin.
i_orderheaderinx-updateflag = 'U'.
"  i_orderheaderinx-price_date = 'X'.  " Do not mark this flag !!!
append i_orderheaderinx.
i_ORDERITEMIN-ITM_NUMBER = I_ORDERS-POSNR.
i_orderitemin-price_date = i_orders-prsdt.
APPEND i_ORDERITEMIN.
i_ORDERITEMINX-ITM_NUMBER = I_ORDERS-POSNR.
i_ORDERITEMINX-UPDATEFLAG = 'U'.
i_orderiteminx-price_date = 'X'.
APPEND i_ORDERITEMINX.
...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume that changing the price date in the header interferes with changing at the item level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2007 20:46:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-salesorder-change/m-p/2858785#M670323</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2007-10-01T20:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_SALESORDER_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-salesorder-change/m-p/2858786#M670324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Excellent!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It worked. Thanks a ton.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2007 21:02:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-salesorder-change/m-p/2858786#M670324</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-01T21:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_SALESORDER_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-salesorder-change/m-p/2858787#M670325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sam&lt;/P&gt;&lt;P&gt;I hope you are doing BAPI_TRANSACTION_COMMIT inside the loop&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;MD&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 19:43:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-salesorder-change/m-p/2858787#M670325</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T19:43:42Z</dc:date>
    </item>
  </channel>
</rss>

