<?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 Calling a protected method in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-protected-method/m-p/1413031#M198841</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to call a protected method of a call, i was trying to search for a solution and i found two options for this. One is calling the method within the class and other is calling the method by creating a subclass and then declaring the method in the public section of the subclass. Since i am new to this, can anyone send me sample syntax for the above requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance, Thirumal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Jul 2006 04:26:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-07-06T04:26:03Z</dc:date>
    <item>
      <title>Calling a protected method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-protected-method/m-p/1413031#M198841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to call a protected method of a call, i was trying to search for a solution and i found two options for this. One is calling the method within the class and other is calling the method by creating a subclass and then declaring the method in the public section of the subclass. Since i am new to this, can anyone send me sample syntax for the above requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance, Thirumal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jul 2006 04:26:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-protected-method/m-p/1413031#M198841</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-06T04:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a protected method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-protected-method/m-p/1413032#M198842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Thirumal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   2 options you have already mentioned in your mail. All the time i have used the method within the class. This is very simple. See some coding on the web using keyword "Java protected method". You will find many example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jul 2006 04:31:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-protected-method/m-p/1413032#M198842</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-06T04:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a protected method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-protected-method/m-p/1413033#M198843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The PROTECTED method cannot be access inside a program. That is why it has been defined as PROTECTED.&lt;/P&gt;&lt;P&gt;If you want to use that, you will define a SUB Class for that and use it inside that.&lt;/P&gt;&lt;P&gt;You can't use a protected method except from within the class itself, or within one of the subclasses. This means you can't use the method from within in a function module.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jul 2006 04:43:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-protected-method/m-p/1413033#M198843</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-06T04:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a protected method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-protected-method/m-p/1413034#M198844</link>
      <description>&lt;P&gt;Hi Thirumal,&lt;/P&gt;&lt;P&gt;You can make a subclass of the base class and access the method.You can refer to this document for the syntax of how to use inheritance by going through this document..&lt;/P&gt;&lt;P&gt;[Removed by the moderator.]&lt;/P&gt;&lt;P&gt;Or you can go to transaction ABAPDOCU and search in the ABAP Objects section and look for inheritance.&lt;/P&gt;&lt;P&gt;You can also go through this link to see programs using inheritance.&lt;/P&gt;&lt;P&gt;[Removed by the moderator.]&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;SP.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2006 05:02:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-protected-method/m-p/1413034#M198844</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-06T05:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a protected method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-protected-method/m-p/1413035#M198845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Amit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am seeing lot of hits for the same, but i am not able to find any sample coding for the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Thirumal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jul 2006 05:04:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-protected-method/m-p/1413035#M198845</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-06T05:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a protected method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-protected-method/m-p/1413036#M198846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sylendra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont have access to anyother site other than SDN.&lt;/P&gt;&lt;P&gt;post some sample code if possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Thirumal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jul 2006 05:09:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-protected-method/m-p/1413036#M198846</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-06T05:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a protected method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-protected-method/m-p/1413037#M198847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thirumal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can go through this SDN link, please do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="128037"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will also post one of the codes regarding Inheritance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT demo_inheritance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS counter DEFINITION.&lt;/P&gt;&lt;P&gt;PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;METHODS: set IMPORTING value(set_value) TYPE i,&lt;/P&gt;&lt;P&gt;increment,&lt;/P&gt;&lt;P&gt;get EXPORTING value(get_value) TYPE i.&lt;/P&gt;&lt;P&gt;PROTECTED SECTION.&lt;/P&gt;&lt;P&gt;DATA count TYPE i.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS counter IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;METHOD set.&lt;/P&gt;&lt;P&gt;count = set_value.&lt;/P&gt;&lt;P&gt;ENDMETHOD.&lt;/P&gt;&lt;P&gt;METHOD increment.&lt;/P&gt;&lt;P&gt;ADD 1 TO count.&lt;/P&gt;&lt;P&gt;ENDMETHOD.&lt;/P&gt;&lt;P&gt;METHOD get.&lt;/P&gt;&lt;P&gt;get_value = count.&lt;/P&gt;&lt;P&gt;ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS counter_ten DEFINITION INHERITING FROM counter.&lt;/P&gt;&lt;P&gt;PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;METHODS increment REDEFINITION.&lt;/P&gt;&lt;P&gt;DATA count_ten(1) TYPE c.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS counter_ten IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;METHOD increment.&lt;/P&gt;&lt;P&gt;DATA modulo TYPE i.&lt;/P&gt;&lt;P&gt;CALL METHOD super-&amp;gt;increment.&lt;/P&gt;&lt;P&gt;WRITE / count.&lt;/P&gt;&lt;P&gt;modulo = count MOD 10.&lt;/P&gt;&lt;P&gt;IF modulo = 0.&lt;/P&gt;&lt;P&gt;count_ten = count_ten + 1.&lt;/P&gt;&lt;P&gt;WRITE count_ten.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: count TYPE REF TO counter,&lt;/P&gt;&lt;P&gt;number TYPE i VALUE 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE OBJECT count TYPE counter_ten.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD count-&amp;gt;set EXPORTING set_value = number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO 20 TIMES.&lt;/P&gt;&lt;P&gt;CALL METHOD count-&amp;gt;increment.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Close the thread once the problem is resolved.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;SP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jul 2006 05:28:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-protected-method/m-p/1413037#M198847</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-06T05:28:54Z</dc:date>
    </item>
  </channel>
</rss>

