<?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: abstarc classes in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abstarc-classes/m-p/2436224#M544967</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;ABSTRACT CLASSES are those classes which are concidered non-complete, we cannot instantiate an ABSTRACT class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It can only be inherited and its methods which does not have implementation will be provided implementation in the SUB CLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Jun 2007 07:40:17 GMT</pubDate>
    <dc:creator>seshatalpasai_madala</dc:creator>
    <dc:date>2007-06-27T07:40:17Z</dc:date>
    <item>
      <title>abstarc classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abstarc-classes/m-p/2436223#M544966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can any some detailed information,faq's regarding only abstract classes in abap,not other than that.I will be very thankful to those who have done it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2007 07:36:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abstarc-classes/m-p/2436223#M544966</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-27T07:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: abstarc classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abstarc-classes/m-p/2436224#M544967</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;ABSTRACT CLASSES are those classes which are concidered non-complete, we cannot instantiate an ABSTRACT class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It can only be inherited and its methods which does not have implementation will be provided implementation in the SUB CLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2007 07:40:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abstarc-classes/m-p/2436224#M544967</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2007-06-27T07:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: abstarc classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abstarc-classes/m-p/2436225#M544968</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;A class defined as ABSTRACT cannot be instantiated , that is one cannot use CREATE OBJECT with reference to the class. &lt;/P&gt;&lt;P&gt;Abstract class can only be accessed using its static components or its subclasses.&lt;/P&gt;&lt;P&gt;Abstract class serves as a template for subclasses&lt;/P&gt;&lt;P&gt;If a class contains any abstract method the whole class becomes abstract.&lt;/P&gt;&lt;P&gt;A method, which is abstract, should be redefined in derived class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLASS c1 DEFINITION.
  PUBLIC SECTION.
     METHODS:  do_something
                         IMPORTING ...i1  TYPE&amp;#133;
                         EXPORTING&amp;#133;e1 TYPE&amp;#133;
                         CHANGING  &amp;#133;c1 TYPE&amp;#133;
                         EXCEPTIONS &amp;#133;en.
  PRIVATE SECTION.
     DATA: &amp;#133;
ENDCLASS.
CLASS c1 IMPLEMENTATION.
 METHOD do_something.
  &amp;#133;
 ENDMETHOD.
ENDCLASS.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The use of abstraction through abstract classes is restricted to the sub classes of a specific node within the inheritance tree. &lt;/P&gt;&lt;P&gt;An Abstract class can declare and implement non abstract methods which its subclasses can use with or without redefining them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2007 11:47:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abstarc-classes/m-p/2436225#M544968</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-27T11:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: abstarc classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abstarc-classes/m-p/2436226#M544969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sandeep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Abstract classes cannot be instantiated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Superclasses are typical use for abstract classes as they are not intended to be &lt;/P&gt;&lt;P&gt; instantiated, but serve as models for subclasses. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Only abstract classes can contain ABSTRACT methods. These are methods with &lt;/P&gt;&lt;P&gt; no implementation in the class where defined. If the subclass of the abstract  &lt;/P&gt;&lt;P&gt; class is not  abstract then the abstract methods must be redefined there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Reference to such abstract classes can therefore be used for polymorphic &lt;/P&gt;&lt;P&gt; access to subclass instances.&lt;/P&gt;&lt;P&gt; Static methods cannot be abstract because they cannot be redefined.&lt;/P&gt;&lt;P&gt; Abstract class can have non-abstract methods also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;lt;u&amp;gt;&amp;lt;b&amp;gt;SAMPLE CODE&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;       Class (Definiton)  zl_lcl_vehicle&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       Definition of Abstract class                                  *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       Abstarct classes are classes that cannot be instantiated.     *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       Instead we can only address the class using its static        *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       components or its subclasses. The major purpose of an         *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       abstract class is to serve as a template for subclasses.      *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS zl_lcl_vehicle DEFINITION ABSTRACT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;An abstract method is defined in an abstract class and cannot be     *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;implemented in that class. If the subclass of that class is not      *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;abstract the abstract methods must be implemented there for the      *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;first time. If a subclass does not implement all of the abstract     *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;methods of its superclasses, it must itself declare them abstract.   *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Static Methods can't be abstract because they cant be redefined.     *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Constructors can't be abstract because they can't be inherited       *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    METHODS: set_make  ABSTRACT IMPORTING  im_make   TYPE string&lt;/P&gt;&lt;P&gt;                                           im_model  TYPE string,&lt;/P&gt;&lt;P&gt;             get_make  ABSTRACT EXPORTING  ex_make   TYPE string&lt;/P&gt;&lt;P&gt;                                           ex_model  TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DATA: gv_make         TYPE string,   " Vehicle make&lt;/P&gt;&lt;P&gt;          gv_model        TYPE string.   " Type or model&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "zl_lcl_vehicle DEFINITION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;       Class (Definiton)  zl_lcl_car&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       Definition of Subclass                                        *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS zl_lcl_car DEFINITION INHERITING FROM zl_lcl_vehicle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;To implement an abstract method in a subclass, it must be redefined  *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;in the subclass using the REDEFINITION addition.                     *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    METHODS: set_make REDEFINITION,&lt;/P&gt;&lt;P&gt;             get_make REDEFINITION,&lt;/P&gt;&lt;P&gt;             get_veh_type EXPORTING  ex_vehtype  TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Since the private components of superclass are not visible in        *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;subclass, private components are declared in the subclass that have  *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the same names as private components of the superclass.              *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: gv_make     TYPE string,   " Vehicle make&lt;/P&gt;&lt;P&gt;          gv_model    TYPE string.   " Type or model&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "zl_lcl_car DEFINITION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;       Class (Implementation)  ZL_LCL_VEHICLE&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       Implementation of Abstract class&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS zl_lcl_vehicle IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Since this class contains only abstract methods which cant be        *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;implemented here, there is no implementation of this class.          *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;If abstract class has some non-abstract methods, those can be        *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;implemented here                                                     *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.               "ZL_LCL_VEHICLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;       Class (Implementation)  zl_lcl_car&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       Implementation of Subclass&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS zl_lcl_car IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD set_make.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Methods that a subclass inherits from a superclass use the private   *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;attributes of the superclass, and not any private components of the  *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;subclass with the same names.                                        *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    IF im_make  IS NOT INITIAL&lt;/P&gt;&lt;P&gt;       AND im_model IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;      gv_make  = im_make.&lt;/P&gt;&lt;P&gt;      gv_model = im_model.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "set_make&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD get_make.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ex_make  = gv_make.&lt;/P&gt;&lt;P&gt;    ex_model = gv_model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "get_make&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD get_veh_type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ex_vehtype = 'car'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "get_veh_type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.               "zl_lcl_car&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Declaring a reference variable with reference to the subclass&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA z_car TYPE REF TO zl_lcl_car.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : gv_make     TYPE string,&lt;/P&gt;&lt;P&gt;       gv_model    TYPE string,&lt;/P&gt;&lt;P&gt;       gv_veh_type TYPE string.&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create instance of the vehicle class&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT z_car.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  z_car-&amp;gt;set_make( EXPORTING im_make  = 'HYUNDAI'&lt;/P&gt;&lt;P&gt;                             im_model = 'SANTRO' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  z_car-&amp;gt;get_make( IMPORTING ex_make  = gv_make&lt;/P&gt;&lt;P&gt;                             ex_model = gv_model ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  z_car-&amp;gt;get_veh_type( IMPORTING ex_vehtype  = gv_veh_type ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WRITE: / 'Vehicle Type :', gv_veh_type,&lt;/P&gt;&lt;P&gt;         / 'Make  :', gv_make,&lt;/P&gt;&lt;P&gt;         / 'Model :', gv_model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Award points if found useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Indrajit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2007 12:19:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abstarc-classes/m-p/2436226#M544969</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-27T12:19:26Z</dc:date>
    </item>
  </channel>
</rss>

