<?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 Code to call friends class method in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-call-friends-class-method/m-p/7404837#M1547262</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Please can someone help me with friends class method call. in global classes&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Megh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moderator message: please search for available information/documentation before asking.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Thomas Zloch on Nov 2, 2010 5:29 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Nov 2010 05:03:02 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-11-02T05:03:02Z</dc:date>
    <item>
      <title>Code to call friends class method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-call-friends-class-method/m-p/7404837#M1547262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Please can someone help me with friends class method call. in global classes&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Megh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moderator message: please search for available information/documentation before asking.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Thomas Zloch on Nov 2, 2010 5:29 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 05:03:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-call-friends-class-method/m-p/7404837#M1547262</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-02T05:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: Code to call friends class method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-call-friends-class-method/m-p/7404838#M1547263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt; Moderator Message: I will continue to remove any content you post whilst it's copy pasted from SAP Help. You have been warned.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Neil Gardiner on Nov 2, 2010 5:07 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 06:00:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-call-friends-class-method/m-p/7404838#M1547263</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-02T06:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: Code to call friends class method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-call-friends-class-method/m-p/7404839#M1547264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is your exact problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The class whose private and protected section you want to use, needs declaration of its friends. You do it in &lt;EM&gt;Friends&lt;/EM&gt; tabstrip. All these classes are allowed then to access these "hiden" sections from outside of the class. Below example how it works with local classes. For global ones the principle stays the same&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLASS lcl_main DEFINITION DEFERRED.


CLASS lcl_other DEFINITION FRIENDS lcl_main. "only LCL_MAIN can use may hiden sections
  PROTECTED SECTION.
    METHODS prot_meth.
  PRIVATE SECTION.
    METHODS priv_meth.
ENDCLASS.                   


CLASS lcl_other IMPLEMENTATION.
  METHOD prot_meth.
    WRITE / 'This is protected method of class lcl_other'.
  ENDMETHOD.                    "prot_meth

  METHOD priv_meth.
    WRITE / 'This is private method of class lcl_other'.
  ENDMETHOD.                    "priv_meth

ENDCLASS.                    


CLASS lcl_main DEFINITION.
  PUBLIC SECTION.
    METHODS call_friends_methods.
  PRIVATE SECTION.
    DATA mr_my_friend TYPE REF TO lcl_other.
ENDCLASS.                   


CLASS lcl_main IMPLEMENTATION.
  METHOD call_friends_methods.
    CREATE OBJECT mr_my_friend.
    mr_my_friend-&amp;gt;prot_meth( ).
    mr_my_friend-&amp;gt;priv_meth( ).
  ENDMETHOD.                    
ENDCLASS.            

START-OF-SELECTION.
  DATA gr_main TYPE REF TO lcl_main.

  CREATE OBJECT gr_main.
  gr_main-&amp;gt;call_friends_methods( ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 08:12:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-call-friends-class-method/m-p/7404839#M1547264</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-11-02T08:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Code to call friends class method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-call-friends-class-method/m-p/7404840#M1547265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice example!! Keep'em coming &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 10:01:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-to-call-friends-class-method/m-p/7404840#M1547265</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-11-02T10:01:26Z</dc:date>
    </item>
  </channel>
</rss>

