<?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: Create superclass from subclass ? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-superclass-from-subclass/m-p/8477596#M1651981</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Senden,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  You can Create subclass using superclass and access their method and Properties but You can't create superclass using subclass. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards &lt;/P&gt;&lt;P&gt;Naveen Subramani.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Dec 2011 04:48:10 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-12-20T04:48:10Z</dc:date>
    <item>
      <title>Create superclass from subclass ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-superclass-from-subclass/m-p/8477592#M1651977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In SE24 i've build a class with attributes/methods (public/protected), but now i want to create a superclass from that (sub)class where some attributes/methods are not in the superclass, but in the subclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a easy way in SE24 to create a superclass from the subclass ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or should i do this manually ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Hans&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 10:07:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-superclass-from-subclass/m-p/8477592#M1651977</guid>
      <dc:creator>h_senden2</dc:creator>
      <dc:date>2011-12-14T10:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Create superclass from subclass ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-superclass-from-subclass/m-p/8477593#M1651978</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;We can not create a super class from sub class this is not possible .&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub Class can inherits the properties of super Class .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warm Regards,&lt;/P&gt;&lt;P&gt;PavanKumar.G&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: pavankumar.g on Dec 20, 2011 9:55 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 11:13:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-superclass-from-subclass/m-p/8477593#M1651978</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-14T11:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: Create superclass from subclass ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-superclass-from-subclass/m-p/8477594#M1651979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can create a sub class inheriting from super class and if required you can redefine the functionalities but not the other way you said.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Parents are born first...only then the children" &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kesav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 11:16:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-superclass-from-subclass/m-p/8477594#M1651979</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2011-12-14T11:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Create superclass from subclass ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-superclass-from-subclass/m-p/8477595#M1651980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the [Refactoring Assistant|http://help-abap.zevolving.com/2011/09/class-editor-refactoring-assistant-i/] integrated in the Class Builder to build the class hierarchy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 11:42:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-superclass-from-subclass/m-p/8477595#M1651980</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-12-14T11:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create superclass from subclass ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-superclass-from-subclass/m-p/8477596#M1651981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Senden,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  You can Create subclass using superclass and access their method and Properties but You can't create superclass using subclass. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards &lt;/P&gt;&lt;P&gt;Naveen Subramani.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 04:48:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-superclass-from-subclass/m-p/8477596#M1651981</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-20T04:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create superclass from subclass ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-superclass-from-subclass/m-p/8477597#M1651982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hans,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just copy your class to a new (super) class. Then delete what you do not want in the super class. Then change the inheritance of the original to make it the subclass. Delete what you already have in the supe class. OK, may take 5-10 minutes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know what the refactoring assistant (available from ABAP 702?) can do for you.&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>Wed, 28 Dec 2011 16:08:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-superclass-from-subclass/m-p/8477597#M1651982</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2011-12-28T16:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Create superclass from subclass ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-superclass-from-subclass/m-p/8477598#M1651983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Clemens,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;I don't know what the refactoring assistant (available from ABAP 702?) can do for you.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refactoring assistant is available from ECC6.0. It is a DnD tool which helps you rebuild your class hierarchy!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2011 04:19:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-superclass-from-subclass/m-p/8477598#M1651983</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-12-29T04:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: Create superclass from subclass ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-superclass-from-subclass/m-p/8477599#M1651984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="Calibri" __jive_macro_name="font"&gt;
Hi Senden,

You must create the parents first with the protected or public methods. Than later you be able to construct the children. You can override the method using polymorphism. For example:
&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*----------------------------------------------------------------------*
*       CLASS cl_employer DEFINITION
*----------------------------------------------------------------------*
CLASS cl_employer DEFINITION .
  PUBLIC SECTION .
    METHODS: get_salary  RETURNING value(salary)  TYPE f .
  PRIVATE SECTION .
    DATA salary TYPE f  VALUE 100 .
ENDCLASS .                    "cl_employer DEFINITION

*----------------------------------------------------------------------*
*       CLASS cl_employer IMPLEMENTATION
*----------------------------------------------------------------------*
CLASS cl_employer IMPLEMENTATION .
  METHOD get_salary .
    salary  = me-&amp;gt;salary * 80 .
  ENDMETHOD .                    "cl_employer
ENDCLASS .                    "cl_employer IMPLEMENTATION

*----------------------------------------------------------------------*
*       CLASS cl_manager DEFINITION
*----------------------------------------------------------------------*
CLASS cl_manager  DEFINITION INHERITING FROM cl_employer .
  PUBLIC SECTION .
    METHODS get_salary REDEFINITION .
  PRIVATE SECTION .
    DATA salary TYPE f  VALUE 100 .
ENDCLASS .                    "cl_manager DEFINITION

*----------------------------------------------------------------------*
*       CLASS cl_manager IMPLEMENTATION
*----------------------------------------------------------------------*
CLASS cl_manager  IMPLEMENTATION .
  METHOD get_salary .
    salary = me-&amp;gt;salary * 100 .
  ENDMETHOD .
ENDCLASS .                    "cl_manager IMPLEMENTATION

START-OF-SELECTION .
DATA e1 TYPE REF TO cl_employer .  CREATE OBJECT e1 .
DATA e2 TYPE REF TO cl_employer .  CREATE OBJECT e2 TYPE cl_manager .

e1-&amp;gt;get_salary( ) .
e2-&amp;gt;get_salary( ) .
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="Calibri" __jive_macro_name="font"&gt;
Don't forget to set a superclass in transaction SE24 on tab PROPERTIES. Also, you can set the attribute FINAL to childrens.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Arthur&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2011 23:12:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-superclass-from-subclass/m-p/8477599#M1651984</guid>
      <dc:creator>Arthur_Silva</dc:creator>
      <dc:date>2011-12-29T23:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Create superclass from subclass ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-superclass-from-subclass/m-p/8477600#M1651985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is not possible. You cannot inherit the (super) class from the (sub)class and change the hierarchy later. Hierarchy change would remove the inherited methods and attributes. You would need to create the (super) class manually.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 09:37:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-superclass-from-subclass/m-p/8477600#M1651985</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-05T09:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create superclass from subclass ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-superclass-from-subclass/m-p/8477601#M1651986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   Inheritance is defined as inheriting the properties of super class to sub class .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; so we can create the subclasses based up on the super classes . so, we cant create the super classes   based up on the sub classes.&lt;/P&gt;&lt;P&gt; This is not possible &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Raghunadh.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jan 2012 05:47:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-superclass-from-subclass/m-p/8477601#M1651986</guid>
      <dc:creator>former_member226225</dc:creator>
      <dc:date>2012-01-25T05:47:52Z</dc:date>
    </item>
  </channel>
</rss>

