<?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_ALM_ORDER_MAINTAIN IT_SRULE ending with errors in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-alm-order-maintain-it-srule-ending-with-errors/m-p/541228#M20138</link>
    <description>&lt;P&gt;Hi Danie&lt;/P&gt;
  &lt;P&gt;Were you able to find the cause and solution for your problem.&lt;/P&gt;
  &lt;P&gt;Can you please share your findings here.&lt;/P&gt;
  &lt;P&gt;Thanks&lt;BR /&gt;Navin&lt;/P&gt;</description>
    <pubDate>Tue, 27 Mar 2018 11:23:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2018-03-27T11:23:34Z</dc:date>
    <item>
      <title>BAPI_ALM_ORDER_MAINTAIN IT_SRULE ending with errors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-alm-order-maintain-it-srule-ending-with-errors/m-p/541224#M20134</link>
      <description>&lt;P&gt;Hello everyone&lt;/P&gt;
  &lt;P&gt;I am trying to update the Production order settlement rules using 'BAPI_ALM_ORDER_MAINTAIN'.&lt;/P&gt;
  &lt;P&gt;I need to change the quantity of the settlement rule but the BAPI always returns errors.&lt;/P&gt;
  &lt;P&gt;IWO_BAPI 402 Error when reading the settlement rule using the external number&lt;BR /&gt;IWO_BAPI2 113 Error during processing of BAPI methods&lt;/P&gt;
  &lt;P&gt;Here is a sample code use to test the BAPI.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;  DATA: lt_srule    TYPE TABLE OF bapi_alm_order_srule,
        ls_srules   LIKE LINE OF lt_srule,
        lt_srule_up TYPE TABLE OF bapi_alm_order_srule_up,
        ls_srule_up LIKE LINE OF lt_srule_up,
        lt_methods  TYPE TABLE OF bapi_alm_order_method,
        ls_methods  LIKE LINE OF lt_methods,
        lt_return   TYPE STANDARD TABLE OF bapiret2,
        ls_return   TYPE bapiret2,
        ls_cobrb    TYPE cobrb.

  DATA: lv_aufnr  TYPE aufnr VALUE '000000501576'.

  SELECT * INTO ls_cobrb FROM cobrb
                        WHERE aufnr = lv_aufnr
                          AND lfdnr = '001'.    
    CLEAR ls_srules.
    ls_srules-objnr          = ls_cobrb-objnr.
    ls_srules-lfdnr          = ls_cobrb-lfdnr.
    ls_srules-equiv_number  = 0.     
    ls_srules-orderid        = ls_cobrb-aufnr.
    APPEND ls_srules TO lt_srule.

    ls_srule_up-equiv_number = 'X'.
    APPEND ls_srule_up TO lt_srule_up.
  ENDSELECT.

  CLEAR ls_methods.
  ls_methods-refnumber  = 1.
  ls_methods-objecttype = 'SRULE'.
  ls_methods-method     = 'CHANGE'.
  ls_methods-objectkey  = lv_aufnr.
  APPEND ls_methods TO lt_methods.

  CLEAR ls_methods.
  ls_methods-refnumber  = 1.
  ls_methods-objecttype = space.
  ls_methods-method     = 'SAVE'.
  ls_methods-objectkey  = lv_aufnr.
  APPEND ls_methods TO lt_methods.

  CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
    TABLES
      it_methods  = lt_methods
      it_srule    = lt_srule
      it_srule_up = lt_srule_up
      return      = lt_return
    .

  READ TABLE lt_return INTO ls_return WITH KEY type = 'A'.
  CHECK sy-subrc &amp;lt;&amp;gt; 0.
  READ TABLE lt_return INTO ls_return WITH KEY type = 'E'.
  CHECK sy-subrc &amp;lt;&amp;gt; 0.

  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      wait = 'X'
    .
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Nov 2017 16:00:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-alm-order-maintain-it-srule-ending-with-errors/m-p/541224#M20134</guid>
      <dc:creator>dstjacques</dc:creator>
      <dc:date>2017-11-15T16:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ALM_ORDER_MAINTAIN IT_SRULE ending with errors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-alm-order-maintain-it-srule-ending-with-errors/m-p/541225#M20135</link>
      <description>&lt;P&gt;I just saw you posted this already &lt;A href="https://answers.sap.com/questions/344930/fm-to-update-production-order-settlement-quantity.html" target="_blank"&gt;here&lt;/A&gt; ...&lt;/P&gt;
  &lt;P&gt;And you already saw the Error was raised in "IBAPI_ALM_ORDERSRULE_CHANGE" ....&lt;/P&gt;
  &lt;P&gt;I have little experience on the Order Settlement in combination with this BAPI, but you might want to check :&lt;/P&gt;
  &lt;UL&gt; 
   &lt;LI&gt;Are there Active BAdI's / Exits that are used to Influence the same Object =&amp;gt; UserExit "EXIT_SAPLCOI1_027" ("ZXWOCU14") ...&lt;/LI&gt; 
   &lt;LI&gt;When Adding a Step in the Methods 'DIALOG', does that help? (Based on SAP-KBA 1496760 and 1494862 : &lt;A href="https://launchpad.support.sap.com/#/notes/1496760" target="_blank"&gt;link&lt;/A&gt; / &lt;A href="https://launchpad.support.sap.com/#/notes/1494862" target="_blank"&gt;link&lt;/A&gt;)&lt;/LI&gt; 
  &lt;/UL&gt;
  &lt;P&gt;&lt;BR /&gt;If you can't get it to work, you might want to look into some older SAP-KBA's on Correction-Reports for Settlement Rules, to see how CRUD-operations are executed there ...&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 20:00:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-alm-order-maintain-it-srule-ending-with-errors/m-p/541225#M20135</guid>
      <dc:creator>NTeunckens</dc:creator>
      <dc:date>2017-11-15T20:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ALM_ORDER_MAINTAIN IT_SRULE ending with errors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-alm-order-maintain-it-srule-ending-with-errors/m-p/541226#M20136</link>
      <description>&lt;P&gt;Hello Nic&lt;/P&gt;
  &lt;P&gt;Thank you for your answer. I effectively posted twice by mistake and I don't know how to delete a post.&lt;/P&gt;
  &lt;P&gt;At the same time, I have been told to not directly use the function IBAPI_ALM_ORDERSRULE_CHANGE. I should used the function BAPI_ALM_ORDER_MAINTENANCE. Where this post has been created.&lt;/P&gt;
  &lt;P&gt;But when using this function, the return table contains the following error records:&lt;/P&gt;
  &lt;P&gt;IWO_BAPI 402 Error when reading the settlement rule using the external number&lt;BR /&gt;IWO_BAPI2 113 Error during processing of BAPI methods&lt;/P&gt;
  &lt;P&gt;I am still at the same point. I cannot update the settlement value and I don't understand the error.&lt;/P&gt;
  &lt;P&gt;I can change the value directly from the tcode CO02 but not from the BAPI.&lt;/P&gt;
  &lt;P&gt;As you proposed, I added a step with the method dialog. It end with the same errors in the return table.&lt;/P&gt;
  &lt;P&gt;The user exit you have proposed is not active.&lt;/P&gt;
  &lt;P&gt;Both SAP notes are related to components EA-APPL where the component doesn't seems to be in the component list provided in SPAM. We are under S4/HANA.&lt;/P&gt;
  &lt;P&gt;All suggestions will be highly appreciated.&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;Regards&lt;/P&gt;
  &lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 22:20:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-alm-order-maintain-it-srule-ending-with-errors/m-p/541226#M20136</guid>
      <dc:creator>dstjacques</dc:creator>
      <dc:date>2017-11-16T22:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ALM_ORDER_MAINTAIN IT_SRULE ending with errors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-alm-order-maintain-it-srule-ending-with-errors/m-p/541227#M20137</link>
      <description>&lt;P&gt;I'm sorry to say I have no Experience with you case, and I could only find some old(er) SAP-KBA's mentioning something that 'might' have to do with the External Number and the Characteristic value ...&lt;/P&gt;
  &lt;UL&gt;
   &lt;LI&gt;SAP-KBA 2447493 : &lt;A href="https://launchpad.support.sap.com/#/notes/2447493" target="_blank"&gt;link&lt;/A&gt; ("BAPI BAPI_ALM_ORDER_MAINTAIN does not provide an option for PSG as settlement receiver. You may have to use customer code program to meet your requirement")&lt;/LI&gt;
   &lt;LI&gt;SAP-KBA 1270258 : &lt;A href="https://launchpad.support.sap.com/#/notes/1270258" target="_blank"&gt;link&lt;/A&gt;&lt;/LI&gt;
   &lt;LI&gt;SAP-KBA 1660309 : &lt;A href="https://launchpad.support.sap.com/#/notes/1660309" target="_blank"&gt;link&lt;/A&gt; (... mentioning UExit "EXIT_SAPLCOI1_027")&lt;/LI&gt;
   &lt;LI&gt;SAP-KBA 579461 : &lt;A href="https://launchpad.support.sap.com/#/notes/579461" target="_blank"&gt;link&lt;/A&gt;&lt;/LI&gt;
   &lt;LI&gt;SAP-KBA 733135 : &lt;A href="https://launchpad.support.sap.com/#/notes/733135" target="_blank"&gt;link&lt;/A&gt;&lt;/LI&gt;
   &lt;LI&gt;SAP-KBA 853144 : &lt;A href="https://launchpad.support.sap.com/#/notes/853144" target="_blank"&gt;link&lt;/A&gt;&lt;/LI&gt;
   &lt;LI&gt;SAP-KBA 480280 : &lt;A href="https://launchpad.support.sap.com/#/notes/480280" target="_blank"&gt;link&lt;/A&gt; (Updated 2016)&lt;/LI&gt;
   &lt;LI&gt;SAP-KBA 1709315 : &lt;A href="https://launchpad.support.sap.com/#/notes/1709315" target="_blank"&gt;link&lt;/A&gt; (... mentioning the use of FM "COPA_PROFITABILITY_SEGMENT" before Execution of Update BAPI's)&lt;/LI&gt;
  &lt;/UL&gt;
  &lt;P&gt;&lt;BR /&gt;&lt;EM&gt;(Only some of those KBA's actually refer to HANA-Systems)&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;To be honest, I get the feeling that you're not going to be able to make the required changes without resorting to Additional Development (UserExit or BAdI "WORKORDER_UPDATE" or something)? If your issue persists, you could always raise your Question to SAP Support, hoping for a clear Explanation what Can and Can Not be done via this or other BAPI ...&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;I'm interested in what you or SAP Support come up with.&lt;/P&gt;
  &lt;P&gt;Nic T.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2017 00:46:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-alm-order-maintain-it-srule-ending-with-errors/m-p/541227#M20137</guid>
      <dc:creator>NTeunckens</dc:creator>
      <dc:date>2017-11-17T00:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ALM_ORDER_MAINTAIN IT_SRULE ending with errors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-alm-order-maintain-it-srule-ending-with-errors/m-p/541228#M20138</link>
      <description>&lt;P&gt;Hi Danie&lt;/P&gt;
  &lt;P&gt;Were you able to find the cause and solution for your problem.&lt;/P&gt;
  &lt;P&gt;Can you please share your findings here.&lt;/P&gt;
  &lt;P&gt;Thanks&lt;BR /&gt;Navin&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 11:23:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-alm-order-maintain-it-srule-ending-with-errors/m-p/541228#M20138</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-03-27T11:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ALM_ORDER_MAINTAIN IT_SRULE ending with errors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-alm-order-maintain-it-srule-ending-with-errors/m-p/541229#M20139</link>
      <description>&lt;P&gt;Until SAP will provide an OSS note to correct the issue, we have taken a direct action and updating the table.&lt;/P&gt;
  &lt;P&gt;We are not recommending this solution but we had no choice at the moment.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;* uv_order_number type aufnr
 UPDATE COBRB SET AQZIF = 0 WHERE aufnr = uv_order_number                                                                                      AND lfdnr = '001'.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 13:52:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-alm-order-maintain-it-srule-ending-with-errors/m-p/541229#M20139</guid>
      <dc:creator>dstjacques</dc:creator>
      <dc:date>2018-05-02T13:52:16Z</dc:date>
    </item>
  </channel>
</rss>

