<?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: Check interface method is implemented in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-interface-method-is-implemented/m-p/11551557#M1936673</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Roland,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wouldn't it be sufficient to find out whether the class in question implements the interface containing this method in general? If such interface is listed in &lt;EM style="color: #333333; font-size: 12px;"&gt;cl_aba_objectdescr-&amp;gt;interfaces &lt;/EM&gt;it should be guaranteed that it also implements the method because a class which binds itself to implement an interface cannot be activated unless it actually does implement all methods from that interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Michal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Mar 2016 14:51:25 GMT</pubDate>
    <dc:creator>former_member201440</dc:creator>
    <dc:date>2016-03-03T14:51:25Z</dc:date>
    <item>
      <title>Check interface method is implemented</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-interface-method-is-implemented/m-p/11551556#M1936672</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;is there a way to check an interface method is implemented? RTTS provide a table of all methods in CL_ABAP_OBJECTDESCR-&amp;gt;METHODS, which has attributes like IS_INTERFACE or IS_REDEFINED. But nothing specific for interface methods like "IS_IMPLEMENTED" (what I would need).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions welcome &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_emote jive_macro" src="https://community.sap.com/98/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Roland&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2016 13:42:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/check-interface-method-is-implemented/m-p/11551556#M1936672</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-03-03T13:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: Check interface method is implemented</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-interface-method-is-implemented/m-p/11551557#M1936673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Roland,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wouldn't it be sufficient to find out whether the class in question implements the interface containing this method in general? If such interface is listed in &lt;EM style="color: #333333; font-size: 12px;"&gt;cl_aba_objectdescr-&amp;gt;interfaces &lt;/EM&gt;it should be guaranteed that it also implements the method because a class which binds itself to implement an interface cannot be activated unless it actually does implement all methods from that interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Michal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2016 14:51:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/check-interface-method-is-implemented/m-p/11551557#M1936673</guid>
      <dc:creator>former_member201440</dc:creator>
      <dc:date>2016-03-03T14:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Check interface method is implemented</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-interface-method-is-implemented/m-p/11551558#M1936674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Michal for your reply. In earlier versions your statement was true; but at least in the system I'm currently developing (7.40), not all interface-methods of an interface need to be implemented. In the interface definition, there is a way to tell the system what to do in case an implementation is missing but the method gets executed ("default fail" will throw an exception, the other option is to simulate empty method behavior).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2016 15:03:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/check-interface-method-is-implemented/m-p/11551558#M1936674</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-03-03T15:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Check interface method is implemented</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-interface-method-is-implemented/m-p/11551559#M1936675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are referring to &lt;A href="https://help.sap.com/abapdocu_750/en/abapinterfaces_partially.htm"&gt;PARTIALLY IMPLEMENTED &lt;/A&gt;, but this is only valid for ABAP Unit Test class. It can't be used anywhere else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See this discussion on Blog - &lt;A href="https://scn.sap.com/community/abap/blog/2013/06/20/abap-news-for-release-740--abap-objects#comment-365341" title="https://scn.sap.com/community/abap/blog/2013/06/20/abap-news-for-release-740--abap-objects#comment-365341"&gt;ABAP News for Release 7.40 - ABAP Objects | SCN&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2016 15:24:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/check-interface-method-is-implemented/m-p/11551559#M1936675</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2016-03-03T15:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: Check interface method is implemented</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-interface-method-is-implemented/m-p/11551560#M1936676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see Roland, I had no clue this was possible. Due to that this task becomes pretty tricky! I'd let you know if something came on my mind. Unfortunately for the time being I am out of ideas &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/98/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2016 15:25:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/check-interface-method-is-implemented/m-p/11551560#M1936676</guid>
      <dc:creator>former_member201440</dc:creator>
      <dc:date>2016-03-03T15:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: Check interface method is implemented</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-interface-method-is-implemented/m-p/11551561#M1936677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you know the methods from the interface and assuming it is a global class, try calling cl_oo_classname_service=&amp;gt;get_all_method_includes it will return the implemented methods&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 08:37:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/check-interface-method-is-implemented/m-p/11551561#M1936677</guid>
      <dc:creator>larshp</dc:creator>
      <dc:date>2016-03-04T08:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: Check interface method is implemented</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-interface-method-is-implemented/m-p/13799988#M2030195</link>
      <description>&lt;P&gt;I know this question is quite old, but I had to find a way to do this in &lt;EM&gt;ABAP for Cloud Development&lt;/EM&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;cl_oo_classname_service is not released for use, so another approach was needed (calling the method with fake parameters is not an option).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The solution comes complements of the XCO classes. With these classes, you can read the source code of the method implementation into a string table. If the method is not implemented, an exception is raised. Here is an example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;TRY.
    xco_cp_abap_repository=&amp;gt;object-&amp;gt;clas-&amp;gt;for( '&amp;lt;name of class&amp;gt;' )-&amp;gt;implementation-&amp;gt;method('&amp;lt;name of interface&amp;gt;~&amp;lt;name of method')-&amp;gt;content( )-&amp;gt;get_source( ).

    " method is implemented

  CATCH cx_xco_runtime_exception.
    " method is not implemented
ENDTRY.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2024 22:26:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/check-interface-method-is-implemented/m-p/13799988#M2030195</guid>
      <dc:creator>MattDion</dc:creator>
      <dc:date>2024-08-19T22:26:40Z</dc:date>
    </item>
  </channel>
</rss>

