<?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: Regarding Super classes in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-super-classes/m-p/5019348#M1167983</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;U can make the super class as friend class if possible and inherit its method.&lt;/P&gt;&lt;P&gt;Programatically, you can inherit all the methods of super class in sub class using &lt;STRONG&gt;inheriting from&lt;/STRONG&gt; as extension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ameet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Jan 2009 11:24:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-07T11:24:28Z</dc:date>
    <item>
      <title>Regarding Super classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-super-classes/m-p/5019347#M1167982</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;I have created one class in SE24. This class will be used as a super class for other classes.&lt;/P&gt;&lt;P&gt;When subclasses are derived from this superclass, i want to make sure that some of the methods of superclasses are redefined by the subclasse compulsarily.&lt;/P&gt;&lt;P&gt;So i want to force the subclasses to redefine complusarily some of the methods of its super class.&lt;/P&gt;&lt;P&gt;Is this feasible. If so please let me know the corresponding approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance !&lt;/P&gt;&lt;P&gt;Pramod&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 11:20:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-super-classes/m-p/5019347#M1167982</guid>
      <dc:creator>i045323</dc:creator>
      <dc:date>2009-01-07T11:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Super classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-super-classes/m-p/5019348#M1167983</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;U can make the super class as friend class if possible and inherit its method.&lt;/P&gt;&lt;P&gt;Programatically, you can inherit all the methods of super class in sub class using &lt;STRONG&gt;inheriting from&lt;/STRONG&gt; as extension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ameet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 11:24:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-super-classes/m-p/5019348#M1167983</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-07T11:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Super classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-super-classes/m-p/5019349#M1167984</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;Check this out this will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inheritance is the concept of passing the behavior of a class to another class. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.You can use an existing class to derive a new class. &lt;/P&gt;&lt;P&gt;2.Derived class inherits the data and methods of a super class. &lt;/P&gt;&lt;P&gt;3.However they can overwrite the methods existing methods and also add new once. &lt;/P&gt;&lt;P&gt;4.Inheritance is to inherit the attributes and methods from a parent class. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inheritance: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inheritance is the process by which object of one class acquire the properties of another class. &lt;/P&gt;&lt;P&gt;Advantage of this property is reusability. &lt;/P&gt;&lt;P&gt;This means we can add additional features to an existing class with out modifying it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Go to SE38. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Provide the program name. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Provide the properties. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Save it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Provide the logic for inheritance. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;-----------------------------------------------------*
*&amp;amp; Report  ZLOCALCLASS_VARIABLES                      *
*&amp;amp;                                                    *
*&amp;amp;-----------------------------------------------*
*&amp;amp;                                                    *
*&amp;amp;                                                  *
*&amp;amp;----------------------------------------------------*REPORT  ZLOCALCLASS_VARIABLES.

*OOPS INHERITANCE
*SUPER CLASS FUNCTIONALITY
*DEFINE THE CLASS.

CLASS CL_LC DEFINITION.
PUBLIC SECTION.
DATA: A TYPE I,
      B TYPE I,
      C TYPE I.
METHODS: DISPLAY,
         MM1.
CLASS-METHODS: MM2.
ENDCLASS.

*CLASS IMPLEMENTATION
CLASS CL_LC IMPLEMENTATION.
METHOD DISPLAY.
WRITE:/ 'THIS IS SUPER CLASS' COLOR 7.
ENDMETHOD.
METHOD MM1.
WRITE:/ 'THIS IS MM1 METHOD IN SUPER CLASS'.
ENDMETHOD.
METHOD MM2.
WRITE:/ 'THIS IS THE STATIC METHOD' COLOR 2.
WRITE:/ 'THIS IS MM2 METHOD IN SUPER CLASS' COLOR 2.
ENDMETHOD.
ENDCLASS.

*SUB CLASS FUNCTIONALITY
*CREATE THE CLASS.
*INHERITING THE SUPER CLASS.
CLASS CL_SUB DEFINITION INHERITING FROM CL_LC. "HOW WE CAN INHERIT
PUBLIC SECTION.
DATA: A1 TYPE I,
      B1 TYPE I,
      C1 TYPE I.
METHODS: DISPLAY REDEFINITION,     "REDEFINE THE SUPER CLASS METHOD
         SUB.
ENDCLASS.

*CLASS IMPLEMENTATION.
CLASS CL_SUB IMPLEMENTATION.
METHOD DISPLAY.
WRITE:/ 'THIS IS THE SUB CLASS OVERWRITE METHOD' COLOR 3.
ENDMETHOD.
METHOD SUB.
WRITE:/ 'THIS IS THE SUB CLASS METHOD' COLOR 3.
ENDMETHOD.
ENDCLASS.

*CREATE THE OBJECT FOR SUB CLASS.
DATA: OBJ TYPE REF TO CL_SUB.
START-OF-SELECTION.
CREATE OBJECT OBJ.
CALL METHOD OBJ-&amp;gt;DISPLAY. "THIS IS SUB CLASS METHOD
CALL METHOD OBJ-&amp;gt;SUB.
WRITE:/'THIS IS THE SUPER CLASS METHODS CALLED BY THE SUB CLASS OBJECT'COLOR 5.
SKIP 1.
CALL METHOD OBJ-&amp;gt;MM1.     "THIS IS SUPER CLASS METHOD
CALL METHOD OBJ-&amp;gt;MM2.

*CREATE THE OBJECT FOR SUPER CLASS.
DATA: OBJ1 TYPE REF TO CL_LC.
START-OF-SELECTION.
CREATE OBJECT OBJ1.
SKIP 3.
WRITE:/ 'WE CAN CALL ONLY SUPER CLASS METHODS BY USING SUPER CLASS OBJECT' COLOR 5.
CALL METHOD OBJ1-&amp;gt;DISPLAY. "THIS IS SUPER CLASS METHOD
CALL METHOD OBJ1-&amp;gt;MM1.
CALL METHOD OBJ1-&amp;gt;MM2.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This example will help you to solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more detailed information GOTO -&amp;gt; SAPTECHNICAL -&amp;gt;Tutorials -&amp;gt; Object Oriented Programming.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Madhu.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code Formatted by: Alvaro Tejada Galindo on Jan 7, 2009 12:13 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 11:33:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-super-classes/m-p/5019349#M1167984</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-07T11:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Super classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-super-classes/m-p/5019350#M1167985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pramod,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABSTRACT methods are for the same purpose. If u make it an abstarct method then it has to be implemented/redefined in subclass. For that you have to make superclass as ABSTRACT class too then you can not instantiate your superclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vishal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 11:47:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-super-classes/m-p/5019350#M1167985</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-07T11:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Super classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-super-classes/m-p/5019351#M1167986</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;These methods needs to be called in the constructor method. If they are made abstract, then they cannot be called in the constructor. &lt;/P&gt;&lt;P&gt;What is the best way to overcome this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 11:57:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-super-classes/m-p/5019351#M1167986</guid>
      <dc:creator>i045323</dc:creator>
      <dc:date>2009-01-07T11:57:47Z</dc:date>
    </item>
  </channel>
</rss>

