<?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: How can I call implemented method ? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-call-implemented-method/m-p/8050511#M1611746</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can also call it, if the method is private or protected using friendship relationship. If class &lt;STRONG&gt;ZCL_DO&lt;/STRONG&gt; will be a friend of  &lt;STRONG&gt;ZCL_TEST&lt;/STRONG&gt;, it may use it's methods as they were public.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is, that you cannot restrict the friendship to only one method, but if this doesn't contradict your requirements, there is your solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLASS zcl_do DEFINITION.
....
ENDCLASS.

CLASS zcl_test DEFINITION FRIENDS zcl_do.
....
ENDCLASS.

CLASS zcl_do IMPLEMENTATION.
 METHOD do_someting.
  DATA lo_ref   TYPE REF TO zcl_test.
  CREATE OBEJCT lo_ref.
  CALL METHOD lo_ref-&amp;gt;zif_test~test.
     
   ENDMETHOD.
ENDCLASS.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Jul 2011 06:08:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-07-11T06:08:14Z</dc:date>
    <item>
      <title>How can I call implemented method ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-call-implemented-method/m-p/8050508#M1611743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an interface &lt;STRONG&gt;ZIF_TEST&lt;/STRONG&gt; and define a class &lt;STRONG&gt;ZCL_TEST&lt;/STRONG&gt; and implement its method &lt;STRONG&gt;TEST&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a class &lt;STRONG&gt;ZCL_DO&lt;/STRONG&gt; and implement the interface &lt;STRONG&gt;ZIF_TEST&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanna &lt;STRONG&gt;ZCL_DO&lt;/STRONG&gt; could use the method &lt;STRONG&gt;TEST&lt;/STRONG&gt; implemented in &lt;STRONG&gt;ZCL_TEST&lt;/STRONG&gt; but how?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see the SAP standard class can do this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: kkktank on Jul 7, 2011 1:08 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2011 11:07:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-call-implemented-method/m-p/8050508#M1611743</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-07T11:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: How can I call implemented method ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-call-implemented-method/m-p/8050509#M1611744</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;Make &lt;STRONG&gt;ZCL_DO&lt;/STRONG&gt;  as a sub class of &lt;STRONG&gt;ZCL_TEST&lt;/STRONG&gt;  so that you can use its methods..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2011 12:10:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-call-implemented-method/m-p/8050509#M1611744</guid>
      <dc:creator>Kiran_Valluru</dc:creator>
      <dc:date>2011-07-07T12:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: How can I call implemented method ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-call-implemented-method/m-p/8050510#M1611745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi kk,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it requires that TEST is a public method. If it is static method, ZCL_DO=&amp;gt;TEST calls the method, if it is instance method, lo_DO-&amp;gt;TEST calls the method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is your code (formatted as code)?&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;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Jul 2011 17:12:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-call-implemented-method/m-p/8050510#M1611745</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2011-07-09T17:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: How can I call implemented method ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-call-implemented-method/m-p/8050511#M1611746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can also call it, if the method is private or protected using friendship relationship. If class &lt;STRONG&gt;ZCL_DO&lt;/STRONG&gt; will be a friend of  &lt;STRONG&gt;ZCL_TEST&lt;/STRONG&gt;, it may use it's methods as they were public.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is, that you cannot restrict the friendship to only one method, but if this doesn't contradict your requirements, there is your solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLASS zcl_do DEFINITION.
....
ENDCLASS.

CLASS zcl_test DEFINITION FRIENDS zcl_do.
....
ENDCLASS.

CLASS zcl_do IMPLEMENTATION.
 METHOD do_someting.
  DATA lo_ref   TYPE REF TO zcl_test.
  CREATE OBEJCT lo_ref.
  CALL METHOD lo_ref-&amp;gt;zif_test~test.
     
   ENDMETHOD.
ENDCLASS.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 06:08:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-call-implemented-method/m-p/8050511#M1611746</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-11T06:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: How can I call implemented method ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-call-implemented-method/m-p/8050512#M1611747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use upcasting same logic as with classes. but you will get implementation specific to child class while u are only interested in the ZCL_TEST class, okay then make the other class a child class of this Test class nad then do not redefine so that when u call instance of the child class -&amp;gt;interface~method u will executr the implementation inside the TEST class.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2011 13:21:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-call-implemented-method/m-p/8050512#M1611747</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-13T13:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: How can I call implemented method ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-call-implemented-method/m-p/8050513#M1611748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks piotrzym.&lt;/P&gt;&lt;P&gt;It solved my problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jul 2011 03:42:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-call-implemented-method/m-p/8050513#M1611748</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-14T03:42:18Z</dc:date>
    </item>
  </channel>
</rss>

