<?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: catch exception when interface method is not implemented in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-when-interface-method-is-not-implemented/m-p/4815140#M1126910</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI, Jose&lt;/P&gt;&lt;P&gt;After I use the try catch block, the exception is still thrown out.&lt;/P&gt;&lt;P&gt;Are there any other ways to handle that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Xin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Dec 2008 08:18:16 GMT</pubDate>
    <dc:creator>former_member658695</dc:creator>
    <dc:date>2008-12-03T08:18:16Z</dc:date>
    <item>
      <title>catch exception when interface method is not implemented</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-when-interface-method-is-not-implemented/m-p/4815138#M1126908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have some interesting scenarios:&lt;/P&gt;&lt;P&gt;There is already a classic BADI and now a new method is to be added to the interface.&lt;/P&gt;&lt;P&gt;For the implementation class, they, for sure, don't implement the new method, however no syntax errors occur.Yet when runtime error 'CALL_METHOD_NOT_IMPLEMENTED' is raised when the new method is called via a variable of the interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;CATCH SYSTEM-EXCEPTIONS CALL_METHOD_NOT_IMPLEMENTED = 4.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;    &lt;EM&gt;CALL METHOD g_badi-&amp;gt;test.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;      &lt;/P&gt;&lt;P&gt;&lt;EM&gt;* do nothing as customer don't necessarily implement the inteface&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ENDCATCH.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even I have try catch statement blocks surrounding the method call, the exception is still raised.&lt;/P&gt;&lt;P&gt;How can I handle it to catch the exception to avoid any short dumps?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2008 02:16:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-when-interface-method-is-not-implemented/m-p/4815138#M1126908</guid>
      <dc:creator>former_member658695</dc:creator>
      <dc:date>2008-11-26T02:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: catch exception when interface method is not implemented</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-when-interface-method-is-not-implemented/m-p/4815139#M1126909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of catching SYSTEM-EXCEPTIONS try like below..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : go_exception TYPE REF TO cx_sy_dyn_call_illegal_method, " Exception object
       gv_reason    TYPE string.                               " Reason for Exception


TRY.
 
    CALL METHOD g_badi-&amp;gt;test.
 
  CATCH cx_sy_dyn_call_illegal_method INTO go_exception.
    gv_reason = go_exception-&amp;gt;if_message~get_text( ).
    " gv_reason has the reason/cause for exception..
ENDTRY.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Jose.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2008 07:16:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-when-interface-method-is-not-implemented/m-p/4815139#M1126909</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-26T07:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: catch exception when interface method is not implemented</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-when-interface-method-is-not-implemented/m-p/4815140#M1126910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI, Jose&lt;/P&gt;&lt;P&gt;After I use the try catch block, the exception is still thrown out.&lt;/P&gt;&lt;P&gt;Are there any other ways to handle that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Xin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 08:18:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-when-interface-method-is-not-implemented/m-p/4815140#M1126910</guid>
      <dc:creator>former_member658695</dc:creator>
      <dc:date>2008-12-03T08:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: catch exception when interface method is not implemented</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-when-interface-method-is-not-implemented/m-p/4815141#M1126911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What does this  ( &lt;STRONG&gt;'exception is still thrown out'&lt;/STRONG&gt; ) mean? a short-dump??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If yes, search for the raised exception object's type( starts with &lt;STRONG&gt;CX_&lt;/STRONG&gt; ) in the short-dump&lt;/P&gt;&lt;P&gt;and use that instead of &lt;STRONG&gt;cx_sy_dyn_call_illegal_method&lt;/STRONG&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Coding like below is the most generic way and ll catch any class based exception.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TRY.
 
    CALL METHOD g_badi-&amp;gt;test. " ur method call
 
  CATCH cx_root.
"Handler code.
ENDTRY.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If u r still getting a short-dump, then probably the exception is being raised somewhere else.......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Jose.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 08:53:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-when-interface-method-is-not-implemented/m-p/4815141#M1126911</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T08:53:54Z</dc:date>
    </item>
  </channel>
</rss>

