<?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 VA02 - maintain settlement rules in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/va02-maintain-settlement-rules/m-p/2166800#M458963</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to maintain a settlement rule within the Sales Order without the user going to the Item Level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to inherit the WBS element from the Header VBAK and on the save of the document automatically create the settlement rule.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried K_SETTLEMENT_RULES* functions and cant seem to get them to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone got any ideas or any advice on this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gary&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Apr 2007 15:31:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-23T15:31:49Z</dc:date>
    <item>
      <title>VA02 - maintain settlement rules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/va02-maintain-settlement-rules/m-p/2166800#M458963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to maintain a settlement rule within the Sales Order without the user going to the Item Level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to inherit the WBS element from the Header VBAK and on the save of the document automatically create the settlement rule.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried K_SETTLEMENT_RULES* functions and cant seem to get them to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone got any ideas or any advice on this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gary&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 15:31:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/va02-maintain-settlement-rules/m-p/2166800#M458963</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T15:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: VA02 - maintain settlement rules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/va02-maintain-settlement-rules/m-p/2166801#M458964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I managed to work this one out myself, but just in case someone else has to do it. here is how I acheived it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Firstly set up all fields on COBRA and COBRB, then call FM &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;             CALL FUNCTION 'K_SETTLEMENT_RULE_FILL'&lt;/P&gt;&lt;P&gt;               TABLES&lt;/P&gt;&lt;P&gt;                 I_COBRA       = lt_cobra&lt;/P&gt;&lt;P&gt;                 I_COBRB       = lt_cobrb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           For some reason the internal system ALWAYS sets the table&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           up as the update status, this causes problems on creation,&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           so we have to change to Insert status.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;             Assign (c_GT_cobrb) to &amp;lt;fs_cobrb&amp;gt;.&lt;/P&gt;&lt;P&gt;             if &amp;lt;fs_cobrb&amp;gt; is assigned.&lt;/P&gt;&lt;P&gt;               LT_COBRB_BT[] = &amp;lt;fs_cobrb&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;               loop at lt_cobrb_bt.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             Somehow the previous records are being kept in so have to&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             delete them or else prog falls over.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;               if lt_cobrb_bt-objnr &amp;lt;&amp;gt; lv_objnr.&lt;/P&gt;&lt;P&gt;                 delete lt_cobrb_bt.&lt;/P&gt;&lt;P&gt;               endif.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               check to see if record exists.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                 select count(*)&lt;/P&gt;&lt;P&gt;                 from cobrb&lt;/P&gt;&lt;P&gt;                 where objnr = lt_cobrb_bt-objnr&lt;/P&gt;&lt;P&gt;                 and   bureg = lt_cobrb_bt-bureg&lt;/P&gt;&lt;P&gt;                 and   lfdnr = lt_cobrb_bt-lfdnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                 if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                 Set the flag to be insert instead of U&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                   lt_cobrb_bt-uflag = 'I'.&lt;/P&gt;&lt;P&gt;                   modify lt_cobrb_bt.&lt;/P&gt;&lt;P&gt;                 else.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                 If settlement exists then exit.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                   lv_settl_exist = 1.&lt;/P&gt;&lt;P&gt;                   exit.&lt;/P&gt;&lt;P&gt;                 endif.&lt;/P&gt;&lt;P&gt;               endloop.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;              If settlement exists then exit.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                if lv_settl_exist = 1.&lt;/P&gt;&lt;P&gt;                  exit.&lt;/P&gt;&lt;P&gt;                endif.&lt;/P&gt;&lt;P&gt;                &amp;lt;fs_cobrb&amp;gt; = LT_COBRB_BT[] .&lt;/P&gt;&lt;P&gt;             endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           For some rreason the internal system ALWAYS sets the table&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           up as the update status, this causes problems on creation,&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           so we have to change to Insert status.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;             Assign (c_GT_cobra) to &amp;lt;fs_cobra&amp;gt;.&lt;/P&gt;&lt;P&gt;             if &amp;lt;fs_cobra&amp;gt; is assigned.&lt;/P&gt;&lt;P&gt;               LT_COBRa_BT[] = &amp;lt;fs_cobra&amp;gt;.&lt;/P&gt;&lt;P&gt;               loop at lt_cobra_bt.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             Somehow the previous records are being kept in so have to&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             delete them or else prog falls over.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;               if lt_cobra_bt-objnr &amp;lt;&amp;gt; lv_objnr.&lt;/P&gt;&lt;P&gt;                 delete lt_cobra_bt.&lt;/P&gt;&lt;P&gt;               endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               check to see if record exists.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                 select count(*)&lt;/P&gt;&lt;P&gt;                 from cobra&lt;/P&gt;&lt;P&gt;                 where objnr = lt_cobra_bt-objnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                 if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                 Set the flag to be insert instead of U&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                   lt_cobra_bt-uflag = 'I'.&lt;/P&gt;&lt;P&gt;                   modify lt_cobra_bt.&lt;/P&gt;&lt;P&gt;                 else.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                 If settlement exists then exit.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                   lv_settl_exist = 1.&lt;/P&gt;&lt;P&gt;                   exit.&lt;/P&gt;&lt;P&gt;                 endif.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               If settlement exists then exit.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                 if lv_settl_exist = 1.&lt;/P&gt;&lt;P&gt;                   exit.&lt;/P&gt;&lt;P&gt;                 endif.&lt;/P&gt;&lt;P&gt;               endloop.&lt;/P&gt;&lt;P&gt;                &amp;lt;fs_cobra&amp;gt; = LT_COBRa_BT[] .&lt;/P&gt;&lt;P&gt;             endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then when the tables have had their update status amended then call FM&lt;/P&gt;&lt;P&gt;             CALL FUNCTION 'K_SETTLEMENT_RULE_SAVE'&lt;/P&gt;&lt;P&gt;               EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               DIALOG                  = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                 OBJNR                   = lv_objnr&lt;/P&gt;&lt;P&gt;                I_STATUS_UPDATE         = ' '&lt;/P&gt;&lt;P&gt;              EXCEPTIONS&lt;/P&gt;&lt;P&gt;                NO_RULE_FOR_OBJNR       = 1&lt;/P&gt;&lt;P&gt;                OTHERS                  = 2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 15:35:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/va02-maintain-settlement-rules/m-p/2166801#M458964</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-25T15:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: VA02 - maintain settlement rules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/va02-maintain-settlement-rules/m-p/2166802#M458965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gary,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please let me know where you wrote this code (I mean in which exit)? I have the similar requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2007 00:36:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/va02-maintain-settlement-rules/m-p/2166802#M458965</guid>
      <dc:creator>maravind</dc:creator>
      <dc:date>2007-12-06T00:36:22Z</dc:date>
    </item>
  </channel>
</rss>

