<?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: ABSTRACT class and method in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abstract-class-and-method/m-p/4071295#M973343</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Each and every method which is defined in definition section, that needs to be implemented in implementation section.&lt;/P&gt;&lt;P&gt;For abstract method, we need to redefine it.&lt;/P&gt;</description>
    <pubDate>Mon, 12 Jun 2023 11:36:43 GMT</pubDate>
    <dc:creator>Shivani11</dc:creator>
    <dc:date>2023-06-12T11:36:43Z</dc:date>
    <item>
      <title>ABSTRACT class and method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abstract-class-and-method/m-p/4071292#M973340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all Abaper experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am doubt on a abap object program shown as below. It is a ABSTRACT class and method. However, during compiling, an error message is displayed "The abstract method 'WRITE_STATUS' may not be implemented". Anyone knows what does it mean? And how to resolve this error?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  ZOOP_ABSTRACT.

* Class Declaration

CLASS vehicle DEFINITION ABSTRACT.
  PUBLIC SECTION.
    METHODS: accelerate,
             write_status ABSTRACT.
  PROTECTED SECTION.
    DATA speed TYPE i.
ENDCLASS.

CLASS plane DEFINITION INHERITING FROM vehicle.
  PUBLIC SECTION.
    METHODS: rise.
  PROTECTED SECTION.
    DATA altitude TYPE i.
ENDCLASS.

CLASS ship DEFINITION INHERITING FROM vehicle.
ENDCLASS.

* Class Implementation

CLASS vehicle IMPLEMENTATION.
  METHOD accelerate.
    speed = speed + 1.
  ENDMETHOD.
ENDCLASS.

CLASS plane IMPLEMENTATION.
  METHOD rise.
    altitude = altitude + 1.
  ENDMETHOD.
  METHOD write_status.
    WRITE: / 'Plane speed:', speed.
    WRITE: / 'Altitude:', altitude.
  ENDMETHOD.
ENDCLASS.

CLASS ship IMPLEMENTATION.
ENDCLASS.

* Global Data

DATA: plane_ref TYPE REF TO plane,
      ship_ref  TYPE REF TO ship.

* Classical Processing Blocks

START-OF-SELECTION.
  CREATE OBJECT: plane_ref,
                 ship_ref.

  CALL METHOD: plane_ref-&amp;gt;accelerate,
               plane_ref-&amp;gt;rise,
               plane_ref-&amp;gt;write_status,
               plane_ref-&amp;gt;accelerate,
               plane_ref-&amp;gt;write_status.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All answers are welcome and appreciate for the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2008 05:48:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abstract-class-and-method/m-p/4071292#M973340</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-09T05:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: ABSTRACT class and method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abstract-class-and-method/m-p/4071293#M973341</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;If you define a class from an abstract class you must redefine the abstract methods also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here vehicle is an abstract class.&lt;/P&gt;&lt;P&gt;you inherited plane and ship from that abstract class.&lt;/P&gt;&lt;P&gt;so you must redefine the write_status method here also and it must be implemented.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this code now,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;****************&lt;/P&gt;&lt;P&gt;REPORT  ZOOP_ABSTRACT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Class Declaration&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS vehicle DEFINITION ABSTRACT.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS: accelerate,&lt;/P&gt;&lt;P&gt;             write_status ABSTRACT.&lt;/P&gt;&lt;P&gt;  PROTECTED SECTION.&lt;/P&gt;&lt;P&gt;    DATA speed TYPE i.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CLASS plane DEFINITION INHERITING FROM vehicle.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS: rise.&lt;/P&gt;&lt;P&gt;    METHODS: write_status REDEFINITION.&lt;/P&gt;&lt;P&gt;  PROTECTED SECTION.&lt;/P&gt;&lt;P&gt;    DATA altitude TYPE i.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CLASS ship DEFINITION INHERITING FROM vehicle.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS: write_status REDEFINITION.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Class Implementation&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CLASS vehicle IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD accelerate.&lt;/P&gt;&lt;P&gt;    speed = speed + 1.&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 plane IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD rise.&lt;/P&gt;&lt;P&gt;    altitude = altitude + 1.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD write_status.&lt;/P&gt;&lt;P&gt;    WRITE: / 'Plane speed:', speed.&lt;/P&gt;&lt;P&gt;    WRITE: / 'Altitude:', altitude.&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 ship IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD write_status.&lt;/P&gt;&lt;P&gt;    WRITE: / 'Plane speed:', speed.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Global Data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA: plane_ref TYPE REF TO plane,&lt;/P&gt;&lt;P&gt;      ship_ref  TYPE REF TO ship.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Classical Processing Blocks&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT: plane_ref,&lt;/P&gt;&lt;P&gt;                 ship_ref.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  CALL METHOD: plane_ref-&amp;gt;accelerate,&lt;/P&gt;&lt;P&gt;               plane_ref-&amp;gt;rise,&lt;/P&gt;&lt;P&gt;               plane_ref-&amp;gt;write_status,&lt;/P&gt;&lt;P&gt;               plane_ref-&amp;gt;accelerate,&lt;/P&gt;&lt;P&gt;               plane_ref-&amp;gt;write_status.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;****************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bhanu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2008 06:49:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abstract-class-and-method/m-p/4071293#M973341</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-09T06:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: ABSTRACT class and method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abstract-class-and-method/m-p/4071294#M973342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bhanu  P.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Really appreciate your valuable answers.&lt;/P&gt;&lt;P&gt;It works!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2008 07:17:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abstract-class-and-method/m-p/4071294#M973342</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-09T07:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: ABSTRACT class and method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abstract-class-and-method/m-p/4071295#M973343</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Each and every method which is defined in definition section, that needs to be implemented in implementation section.&lt;/P&gt;&lt;P&gt;For abstract method, we need to redefine it.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2023 11:36:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abstract-class-and-method/m-p/4071295#M973343</guid>
      <dc:creator>Shivani11</dc:creator>
      <dc:date>2023-06-12T11:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: ABSTRACT class and method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abstract-class-and-method/m-p/4071296#M973344</link>
      <description>&lt;P&gt;It's what the accepted answer already says. Any reason to post again the same answer, 15 years later?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2023 11:55:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abstract-class-and-method/m-p/4071296#M973344</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-06-12T11:55:40Z</dc:date>
    </item>
  </channel>
</rss>

