<?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: Validating Internal Order Settlement Rule during creation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-internal-order-settlement-rule-during-creation/m-p/1134964#M112778</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I just wanted to come back and add this extra information incase someone else needs it in the future:&lt;/P&gt;&lt;P&gt;I think we were finally able to come up with an acceptable solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;The Problem:&lt;/P&gt;&lt;P&gt;============&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;SAP does not provide an easy way to validate detail section of a settlement rule for an internal order. The user exits that are available do not import the COBRB structure that contains the screen data entered by user in the detail screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Solution:&lt;/P&gt;&lt;P&gt;===========&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Watch out for wrapped lines!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(1) Implement the BADI: &amp;lt;b&amp;gt;CO_SRULE_CHECK&amp;lt;/b&amp;gt;; NO filter; Settlement Rule Custom Validation BADI&lt;/P&gt;&lt;P&gt;(see current thread for details)&lt;/P&gt;&lt;P&gt;Inside the &amp;lt;b&amp;gt;DISTRIBUTION_RULE_CHECK&amp;lt;/b&amp;gt; method of your BADI, implement your custom validation. You can call out to your standard CO validaton module, or whatever.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(2) Implement user exit: EXIT_SAPLRKIO_002(include zxaufu02): Call settlement_rule_check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(3) Implement a subroutine as shown (adapt to your business environment):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM settlement_rule_check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: exit type ref to IF_EX_CO_SRULE_CHECK.&lt;/P&gt;&lt;P&gt;DATA: lt_cobra LIKE cobra OCCURS 0 WITH HEADER LINE, lt_cobrb LIKE cobrb OCCURS 0 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;don't validate in display mode&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CHECK I_ACTVT NE 03.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Call function to get the current settlement rule from&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;memory buffer (this is the crux of the solution)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call function 'K_SETTLEMENT_RULE_GET'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            objnr     = i_aufk-OBJNR&lt;/P&gt;&lt;P&gt;            x_all     = ' '&lt;/P&gt;&lt;P&gt;          TABLES&lt;/P&gt;&lt;P&gt;            e_cobra   = lt_cobra&lt;/P&gt;&lt;P&gt;            e_cobrb   = lt_cobrb&lt;/P&gt;&lt;P&gt;          EXCEPTIONS&lt;/P&gt;&lt;P&gt;            not_found = 1&lt;/P&gt;&lt;P&gt;            others    = 2.&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; raising E_MESSAGE.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;Now Prepare/call BADI to check the custom rules&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  class CL_EX_CO_SRULE_CHECK definition load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;create an instance of BADI&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method cl_exithandler=&amp;gt;get_instance&lt;/P&gt;&lt;P&gt;       changing&lt;/P&gt;&lt;P&gt;        instance = exit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;call the check method of the BADI&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method: exit-&amp;gt;DISTRIBUTION_RULE_CHECK&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;           DISTRIBUTION_RULE = lt_cobrb&lt;/P&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;P&gt;     not_allowed                = 1&lt;/P&gt;&lt;P&gt;     not_allowed_with_msg       = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;either use a standard message function or create your&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;own&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF sy-subrc = 1.&lt;/P&gt;&lt;P&gt;    PERFORM message_send&lt;/P&gt;&lt;P&gt;      USING 'KD' 'E' '027' space space space space space.&lt;/P&gt;&lt;P&gt;  ELSEIF sy-subrc = 2.&lt;/P&gt;&lt;P&gt;    PERFORM message_send&lt;/P&gt;&lt;P&gt;      USING sy-msgid sy-msgty sy-msgno&lt;/P&gt;&lt;P&gt;            sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4&lt;/P&gt;&lt;P&gt;            space.                   "...&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(4) Test, Test, Test. Hope it works for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Mar 2006 18:27:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-03-20T18:27:15Z</dc:date>
    <item>
      <title>Validating Internal Order Settlement Rule during creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-internal-order-settlement-rule-during-creation/m-p/1134957#M112771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does anybody know of a user exit, badi, anything, that can be used to validate assignement data when creating/changing the settlement rule on an internal order?&lt;/P&gt;&lt;P&gt;Appreciate the help...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2006 01:04:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-internal-order-settlement-rule-during-creation/m-p/1134957#M112771</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-14T01:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: Validating Internal Order Settlement Rule during creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-internal-order-settlement-rule-during-creation/m-p/1134958#M112772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the following exit for assignment data validation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;User exit M06B0002.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think, this would help you out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Vanitha S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2006 05:38:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-internal-order-settlement-rule-during-creation/m-p/1134958#M112772</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-14T05:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: Validating Internal Order Settlement Rule during creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-internal-order-settlement-rule-during-creation/m-p/1134959#M112773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vanitha, thanks for the response. However, this is not what I was looking for. The exit that you mentioned is used during PO requisition release. IT provides the communication component during the release.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I am looking for is an exit that gets called when a user is creating/changing settlement rule on an internal order master. (NOTE: NOT during order settlement)&lt;/P&gt;&lt;P&gt;There are 7 exits that I can currently find, however non of them have the structure/assignments for the settlement (receiver, sender, etc) data. We would like to validate the data that user enters in the settlement rule detail fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2006 17:30:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-internal-order-settlement-rule-during-creation/m-p/1134959#M112773</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-14T17:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: Validating Internal Order Settlement Rule during creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-internal-order-settlement-rule-during-creation/m-p/1134960#M112774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the BADI CO_SRULE_CHECK and its method DISTRIBUTION_RULE_CHECK...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see if it can be used in your scenario...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Renjith&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2006 17:35:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-internal-order-settlement-rule-during-creation/m-p/1134960#M112774</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-14T17:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: Validating Internal Order Settlement Rule during creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-internal-order-settlement-rule-during-creation/m-p/1134961#M112775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Renjith, thanks for your response. Would you happen to have a sample code on how to implement this BADI?&lt;/P&gt;&lt;P&gt;We would like to insert custom validation to check assignment values when user is creating/changing the settlement rule. A sample code will really help...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2006 18:11:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-internal-order-settlement-rule-during-creation/m-p/1134961#M112775</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-14T18:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Validating Internal Order Settlement Rule during creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-internal-order-settlement-rule-during-creation/m-p/1134962#M112776</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;&lt;/P&gt;&lt;P&gt;Steps for implementing a BADI&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steps:&lt;/P&gt;&lt;P&gt;1.Execute Business Add-In(BADI) transaction SE18&lt;/P&gt;&lt;P&gt;2.Enter BADI name i.e. CO_SRULE_CHECK and press the display button &lt;/P&gt;&lt;P&gt;3.Select menu option Implementation-&amp;gt;Create&lt;/P&gt;&lt;P&gt;4.Give implementation a name such as Z_CO_SRULE_CHECK&lt;/P&gt;&lt;P&gt;5.You can now make any changes you require to the BADI within this implementation, for example choose the Interface tab&lt;/P&gt;&lt;P&gt;6.Double click on the method you want to change, you can now enter  any code you require.&lt;/P&gt;&lt;P&gt;7.Please note to find out what import and export parameters a method has got return the original BADI definition (i.e. CO_SRULE_CHECK) and double click on the method name for example within DISTRIBUTION_RULE_CHECK contract is a method&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;supposing you want to validate the settlement type..then the code would be like...&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if DISTRIBUTION_RULE-perbz &amp;lt;&amp;gt; 'CORRECT'.&lt;/P&gt;&lt;P&gt;    raise not_allowed.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8.When changes have been made activate the implementation in SE19&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Renjith.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2006 18:29:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-internal-order-settlement-rule-during-creation/m-p/1134962#M112776</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-14T18:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Validating Internal Order Settlement Rule during creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-internal-order-settlement-rule-during-creation/m-p/1134963#M112777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Renjith, thanks again for your input. I think we are getting hot! You know, there is a certain prerequisite that we are missing: The BADI method call requires that we export a COBRB (settlement rule) structure. To call the BADI, we have to create an instance of it and call its method passing it r_cobrb (which is of type COBRB).&lt;/P&gt;&lt;P&gt;My problem is that r_cobrb is not filled and the core of the issue is that I don't know how to obtain an internal table/structure that contains the data entered by the user on the settlement rule detail screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please forgive my ignorance as I am not very familiar with how the BADI architecture should work. However, here's what I attempted to do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;==============PSEUDOCODE SNIPPET==================&lt;/P&gt;&lt;P&gt;DATA: Settle_exit type ref to IF_EX_CO_SRULE_CHECK.&lt;/P&gt;&lt;P&gt;DATA: r_cobrb LIKE cobrb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class CL_EX_CO_SRULE_CHECK definition load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method cl_exithandler=&amp;gt;get_instance&lt;/P&gt;&lt;P&gt;     changing&lt;/P&gt;&lt;P&gt;      instance = Settle_exit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method: Settle_exit-&amp;gt;DISTRIBUTION_RULE_CHECK&lt;/P&gt;&lt;P&gt;     EXPORTING DISTRIBUTION_RULE = r_cobrb.&lt;/P&gt;&lt;P&gt;================CODE Ends==========================&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(1) To implement this code, I have to place it somewhere in the call chain after the user clicks the Save button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(2) Since we cannot change standard SAP, and have to do it in a customer exit (which is a function module), there lies my problem. I need r_cobrb! No exit that I have found so far passes COBRB. They all have AUFK which is not what I want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(3) Basically, the BADI does not get triggered like a standard user exit, unless I create an instance and call it. That is, with a standard user exit, SAP fills in the structure and pass you the data via a function module. Then you can manipulate this data as you wish. With the BADI, I don't see this similar mechanism. OR am I missing something?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2006 01:53:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-internal-order-settlement-rule-during-creation/m-p/1134963#M112777</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-15T01:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: Validating Internal Order Settlement Rule during creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-internal-order-settlement-rule-during-creation/m-p/1134964#M112778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I just wanted to come back and add this extra information incase someone else needs it in the future:&lt;/P&gt;&lt;P&gt;I think we were finally able to come up with an acceptable solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;The Problem:&lt;/P&gt;&lt;P&gt;============&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;SAP does not provide an easy way to validate detail section of a settlement rule for an internal order. The user exits that are available do not import the COBRB structure that contains the screen data entered by user in the detail screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Solution:&lt;/P&gt;&lt;P&gt;===========&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Watch out for wrapped lines!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(1) Implement the BADI: &amp;lt;b&amp;gt;CO_SRULE_CHECK&amp;lt;/b&amp;gt;; NO filter; Settlement Rule Custom Validation BADI&lt;/P&gt;&lt;P&gt;(see current thread for details)&lt;/P&gt;&lt;P&gt;Inside the &amp;lt;b&amp;gt;DISTRIBUTION_RULE_CHECK&amp;lt;/b&amp;gt; method of your BADI, implement your custom validation. You can call out to your standard CO validaton module, or whatever.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(2) Implement user exit: EXIT_SAPLRKIO_002(include zxaufu02): Call settlement_rule_check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(3) Implement a subroutine as shown (adapt to your business environment):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM settlement_rule_check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: exit type ref to IF_EX_CO_SRULE_CHECK.&lt;/P&gt;&lt;P&gt;DATA: lt_cobra LIKE cobra OCCURS 0 WITH HEADER LINE, lt_cobrb LIKE cobrb OCCURS 0 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;don't validate in display mode&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CHECK I_ACTVT NE 03.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Call function to get the current settlement rule from&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;memory buffer (this is the crux of the solution)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call function 'K_SETTLEMENT_RULE_GET'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            objnr     = i_aufk-OBJNR&lt;/P&gt;&lt;P&gt;            x_all     = ' '&lt;/P&gt;&lt;P&gt;          TABLES&lt;/P&gt;&lt;P&gt;            e_cobra   = lt_cobra&lt;/P&gt;&lt;P&gt;            e_cobrb   = lt_cobrb&lt;/P&gt;&lt;P&gt;          EXCEPTIONS&lt;/P&gt;&lt;P&gt;            not_found = 1&lt;/P&gt;&lt;P&gt;            others    = 2.&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; raising E_MESSAGE.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;Now Prepare/call BADI to check the custom rules&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  class CL_EX_CO_SRULE_CHECK definition load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;create an instance of BADI&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method cl_exithandler=&amp;gt;get_instance&lt;/P&gt;&lt;P&gt;       changing&lt;/P&gt;&lt;P&gt;        instance = exit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;call the check method of the BADI&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method: exit-&amp;gt;DISTRIBUTION_RULE_CHECK&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;           DISTRIBUTION_RULE = lt_cobrb&lt;/P&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;P&gt;     not_allowed                = 1&lt;/P&gt;&lt;P&gt;     not_allowed_with_msg       = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;either use a standard message function or create your&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;own&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF sy-subrc = 1.&lt;/P&gt;&lt;P&gt;    PERFORM message_send&lt;/P&gt;&lt;P&gt;      USING 'KD' 'E' '027' space space space space space.&lt;/P&gt;&lt;P&gt;  ELSEIF sy-subrc = 2.&lt;/P&gt;&lt;P&gt;    PERFORM message_send&lt;/P&gt;&lt;P&gt;      USING sy-msgid sy-msgty sy-msgno&lt;/P&gt;&lt;P&gt;            sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4&lt;/P&gt;&lt;P&gt;            space.                   "...&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(4) Test, Test, Test. Hope it works for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Mar 2006 18:27:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-internal-order-settlement-rule-during-creation/m-p/1134964#M112778</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-20T18:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: Validating Internal Order Settlement Rule during creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-internal-order-settlement-rule-during-creation/m-p/1134965#M112779</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;Thankyou very much for adding your solution. You have solved a problem that I have been grappling with for some time - how to access the cost settlement details from the input screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;Ros&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 May 2007 05:32:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-internal-order-settlement-rule-during-creation/m-p/1134965#M112779</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-21T05:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Validating Internal Order Settlement Rule during creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-internal-order-settlement-rule-during-creation/m-p/1134966#M112780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not able to see the BADI CO_SRULE_CHECK in SE18.&lt;/P&gt;&lt;P&gt;Can u pls guide me in this regard?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Points will be rewarded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thnx inadvance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2007 11:46:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-internal-order-settlement-rule-during-creation/m-p/1134966#M112780</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-05T11:46:13Z</dc:date>
    </item>
  </channel>
</rss>

