<?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: Local exception class in global class in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-exception-class-in-global-class/m-p/8860178#M1685997</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Dirk,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i cant follow that problem.&lt;/P&gt;&lt;P&gt;I tried the following:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Created a global class.&lt;/LI&gt;&lt;LI&gt;Entered the following under Local Types:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;*"* use this source file for any type declarations (class&lt;BR /&gt;&lt;SPAN class="L0S31"&gt;*"* definitions, interfaces or data types) you need for method&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="L0S31"&gt;*"* implementation or private method's signature&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="L0S52"&gt;CLASS &lt;/SPAN&gt;lcl_cx &lt;SPAN class="L0S52"&gt;DEFINITION &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;INHERITING &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;FROM &lt;/SPAN&gt;cx_static_check&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="L0S52"&gt;ENDCLASS&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="L0S31"&gt;"lcl_cx DEFINITION&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;&lt;SPAN class="L0S31"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class="L0S31"&gt;&lt;SPAN class="L0S31"&gt;Declared the exception in a private testmethod with the following code:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;&lt;SPAN class="L0S31"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;METHOD i_raise_it&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="L0S52"&gt;RAISE &lt;/SPAN&gt;lcl_cx&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="L0S52"&gt;ENDMETHOD&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;No error occurs.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;Even if I make the method public, it works.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I did this in ECC 6.0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe this works not until a special version?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan Wolf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Oct 2012 07:44:52 GMT</pubDate>
    <dc:creator>wol</dc:creator>
    <dc:date>2012-10-22T07:44:52Z</dc:date>
    <item>
      <title>Local exception class in global class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-exception-class-in-global-class/m-p/8860175#M1685994</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;in SE24, tab "local types", the comment given by SAP says:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;*"* use this source file for any type declarations (class&lt;BR /&gt;&lt;SPAN class="L0S31"&gt;*"* definitions, interfaces or data types) you need for method&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="L0S31"&gt;*"* implementation or private method's signature&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;&lt;SPAN class="L0S31"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;Now I've defined a local exception class in this tab:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;CLASS lcx_my_exception DEFINITION INHERITING FROM cx_static_check.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;ENDCLASS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;So far no error occurs.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;But when trying to use it in the signature of a private! class, it is not known and I'm asked wether I like to create it as a global exception class.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;Why isn't the exception class recognized?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;My mistake or a bug?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;Dirk&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2012 08:00:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-exception-class-in-global-class/m-p/8860175#M1685994</guid>
      <dc:creator>dirk_wittenberg</dc:creator>
      <dc:date>2012-06-29T08:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: Local exception class in global class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-exception-class-in-global-class/m-p/8860176#M1685995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your mistake. Class based exceptions for methods must be globally defined exceptions. It'd be kind of nice if you could use private ones though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2012 07:37:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-exception-class-in-global-class/m-p/8860176#M1685995</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2012-07-05T07:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Local exception class in global class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-exception-class-in-global-class/m-p/8860177#M1685996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, it would be nice. &lt;/P&gt;&lt;P&gt;If the method is private it's called only inside the class. Why have exceptions thrown by this method be known outside? It's inconsistent in my optionion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dirk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2012 08:15:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-exception-class-in-global-class/m-p/8860177#M1685996</guid>
      <dc:creator>dirk_wittenberg</dc:creator>
      <dc:date>2012-07-05T08:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: Local exception class in global class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-exception-class-in-global-class/m-p/8860178#M1685997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Dirk,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i cant follow that problem.&lt;/P&gt;&lt;P&gt;I tried the following:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Created a global class.&lt;/LI&gt;&lt;LI&gt;Entered the following under Local Types:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;*"* use this source file for any type declarations (class&lt;BR /&gt;&lt;SPAN class="L0S31"&gt;*"* definitions, interfaces or data types) you need for method&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="L0S31"&gt;*"* implementation or private method's signature&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="L0S52"&gt;CLASS &lt;/SPAN&gt;lcl_cx &lt;SPAN class="L0S52"&gt;DEFINITION &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;INHERITING &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;FROM &lt;/SPAN&gt;cx_static_check&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="L0S52"&gt;ENDCLASS&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="L0S31"&gt;"lcl_cx DEFINITION&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;&lt;SPAN class="L0S31"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class="L0S31"&gt;&lt;SPAN class="L0S31"&gt;Declared the exception in a private testmethod with the following code:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;&lt;SPAN class="L0S31"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;METHOD i_raise_it&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="L0S52"&gt;RAISE &lt;/SPAN&gt;lcl_cx&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="L0S52"&gt;ENDMETHOD&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;No error occurs.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;Even if I make the method public, it works.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I did this in ECC 6.0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe this works not until a special version?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan Wolf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 07:44:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-exception-class-in-global-class/m-p/8860178#M1685997</guid>
      <dc:creator>wol</dc:creator>
      <dc:date>2012-10-22T07:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Local exception class in global class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-exception-class-in-global-class/m-p/8860179#M1685998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Dirk,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;did you solve the problem?&lt;/P&gt;&lt;P&gt;Could you share the crux of the matter with us?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan Wolf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2012 07:05:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-exception-class-in-global-class/m-p/8860179#M1685998</guid>
      <dc:creator>wol</dc:creator>
      <dc:date>2012-10-24T07:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Local exception class in global class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-exception-class-in-global-class/m-p/8860180#M1685999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sorry not yet, but I will keep you informed.&lt;/P&gt;&lt;P&gt;Currently there's not much time for experiments &lt;SPAN __jive_emoticon_name="plain" __jive_macro_name="emoticon" class="jive_macro jive_macro_emoticon jive_emote" src="https://community.sap.com/1031/images/emoticons/plain.gif"&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dirk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2012 19:38:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-exception-class-in-global-class/m-p/8860180#M1685999</guid>
      <dc:creator>dirk_wittenberg</dc:creator>
      <dc:date>2012-10-24T19:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: Local exception class in global class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-exception-class-in-global-class/m-p/8860181#M1686000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OT: Sounds a bit like "Inbetriebnahme"...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2012 19:44:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-exception-class-in-global-class/m-p/8860181#M1686000</guid>
      <dc:creator>wol</dc:creator>
      <dc:date>2012-10-24T19:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: Local exception class in global class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-exception-class-in-global-class/m-p/8860182#M1686001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dirk,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been trough the same issue and "solved" it by declaring the super class (CX_DYNAMIC_CHECK in my case) in the signature of my private method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Works fine for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Custodio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Apr 2013 01:44:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-exception-class-in-global-class/m-p/8860182#M1686001</guid>
      <dc:creator>custodio_deoliveira</dc:creator>
      <dc:date>2013-04-22T01:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Local exception class in global class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-exception-class-in-global-class/m-p/8860183#M1686002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Custodio,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your reply.&lt;/P&gt;&lt;P&gt;I tested your solution and it worked. It's a possible workaround of course but it makes the code a bit "unclear" beause you can't see in the signature which exception can actually be thrown.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dirk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Apr 2013 11:11:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-exception-class-in-global-class/m-p/8860183#M1686002</guid>
      <dc:creator>dirk_wittenberg</dc:creator>
      <dc:date>2013-04-22T11:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Local exception class in global class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-exception-class-in-global-class/m-p/8860184#M1686003</link>
      <description>&lt;P&gt;I use eclipse to write this:&lt;/P&gt;&lt;P&gt;In the sample class below, I use a private method to process Fibonacci number called in the public class " get_fib".&lt;/P&gt;&lt;P&gt;hope this answers your question.&lt;/P&gt;&lt;P&gt;In the LOCAL TYPES&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*"* use this source file for the definition and implementation of
*"* local helper classes, interface definitions and type
*"* declarations


CLASS lcx_input IMPLEMENTATION.


 METHOD constructor.


 super-&amp;gt;constructor( ).
 m_message = i_message.


 ENDMETHOD.


 METHOD get_message.


  r_message = m_message.


 ENDMETHOD.




ENDCLASS.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In the CLASS-RELEVANT LOCAL TYPES&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*"* use this source file for any type of declarations (class
*"* definitions, interfaces or type declarations) you need for
*"* components in the private section


CLASS lcx_input DEFINITION
INHERITING FROM cx_static_check FINAL.


 PUBLIC SECTION.
 METHODS: constructor IMPORTING i_message TYPE string,
          get_message RETURNING VALUE(r_message) TYPE string.


 PRIVATE SECTION.
 DATA: m_message TYPE string.


ENDCLASS.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In the GLOBAL CLASS &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLASS ycl_fibonacci_number DEFINITION
  PUBLIC
  FINAL
  CREATE PUBLIC .


  PUBLIC SECTION.
    INTERFACES if_oo_adt_classrun.
    METHODS get_fib IMPORTING i_index             TYPE i
                    RETURNING VALUE(r_fib_number) TYPE i
                    RAISING   /iwbep/cx_mgw_busi_exception.
  PROTECTED SECTION.
  PRIVATE SECTION.
    METHODS process_fib IMPORTING i_index             TYPE i
                        RETURNING VALUE(r_fib_number) TYPE i
                        RAISING   lcx_input.
ENDCLASS.






CLASS ycl_fibonacci_number IMPLEMENTATION.
  METHOD get_fib.


    TRY.
        r_fib_number = process_fib( i_index ).


      CATCH lcx_input INTO DATA(input_ex).


        RAISE EXCEPTION TYPE /iwbep/cx_mgw_busi_exception
          EXPORTING
            textid            = /iwbep/cx_mgw_busi_exception=&amp;gt;business_error_unlimited
            message_unlimited = input_ex-&amp;gt;get_message( ).


    ENDTRY.


  ENDMETHOD.


  METHOD if_oo_adt_classrun~main.


  ENDMETHOD.


  METHOD process_fib.


    IF i_index &amp;lt; 0.
      RAISE EXCEPTION TYPE lcx_input
        EXPORTING
          i_message = 'Input can not be less than zero'.
    ENDIF.




    IF i_index = 0.
      r_fib_number = 0.


    ELSEIF i_index = 1.
      r_fib_number = 1.


    ELSE.
      r_fib_number = process_fib( i_index - 1 ) + process_fib( i_index - 2 ).
    ENDIF.




  ENDMETHOD.


ENDCLASS.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Feb 2021 04:55:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-exception-class-in-global-class/m-p/8860184#M1686003</guid>
      <dc:creator>former_member665784</dc:creator>
      <dc:date>2021-02-04T04:55:01Z</dc:date>
    </item>
  </channel>
</rss>

