<?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: Constructors in Inheritance. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/constructors-in-inheritance/m-p/5904702#M1328740</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The show_output method was never been called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o_vessel-&amp;gt;show_output is required in the main method of demo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Silly Mistake.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Abhinab Mishra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Jul 2009 22:14:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-08T22:14:51Z</dc:date>
    <item>
      <title>Constructors in Inheritance.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constructors-in-inheritance/m-p/5904701#M1328739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  Z_INHERITANCE_CONSTRUCTOR.
CLASS demo DEFINITION.
  PUBLIC SECTION.
  CLASS-METHODS main.
  ENDCLASS.
CLASS vessel DEFINITION.
  PUBLIC SECTION.
  METHODS : constructor IMPORTING i1 TYPE string
                                                            i2  TYPE string,
                     show_output.
  PROTECTED SECTION.
  DATA name TYPE string.
  DATA sex TYPE string.
  ENDCLASS.
CLASS ship DEFINITION INHERITING FROM vessel.
  ENDCLASS.
CLASS motorship DEFINITION INHERITING FROM ship.
  PUBLIC SECTION.
  METHODS : constructor IMPORTING i_name TYPE string
                                                            i_fuel_amount TYPE i.
  PRIVATE SECTION.
  DATA fuel_amount TYPE i.
  ENDCLASS.

CLASS vessel IMPLEMENTATION.
  METHOD constructor .
    name = i1.
    sex =  i2.
  ENDMETHOD. "constructor
  METHOD show_output . 
     DATA : name TYPE string,
                 sex TYPE string,
                 output type string.
                name = me-&amp;gt;name.
                sex = me-&amp;gt;sex.
     CONCATENATE 'The Name is : ' name '&amp;amp; The sex is :' sex  into output.
     MESSAGE output TYPE 'I'.
  ENDMETHOD. "show_output
  ENDCLASS.
CLASS motorship IMPLEMENTATION.
  METHOD constructor .
  super-&amp;gt;constructor( i1 = 'Abhinab' i2 = 'M' ).
  fuel_amount = i_fuel_amount.
  ENDMETHOD. "constructor
  ENDCLASS.
CLASS demo IMPLEMENTATION.
  METHOD main .
 DATA : o_vessel TYPE REF TO vessel,
        o_ship TYPE REF TO ship,
        o_motorship TYPE REF TO motorship.
 CREATE OBJECT : o_vessel EXPORTING i1 = 'Vivien'
                                                                    i2 = 'M',
                                o_ship EXPORTING i1 = 'Sia'
                                                                i2 = 'F',
                                o_motorship EXPORTING i_fuel_amount = '1200'
                                                                          i_name = 'Eules'.
  ENDMETHOD. "main
  ENDCLASS.

  START-OF-SELECTION.
  demo=&amp;gt;main( ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my code the method show_output doesn't get implemented,but when i place the same code of show_output  in the constructor method the code is getting executed.&lt;/P&gt;&lt;P&gt;I am not able to figure out the reason behind this.&lt;/P&gt;&lt;P&gt;can anybody please help me understand why is this happening??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Abhinab Mishra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2009 21:19:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constructors-in-inheritance/m-p/5904701#M1328739</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-08T21:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: Constructors in Inheritance.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constructors-in-inheritance/m-p/5904702#M1328740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The show_output method was never been called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o_vessel-&amp;gt;show_output is required in the main method of demo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Silly Mistake.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Abhinab Mishra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2009 22:14:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constructors-in-inheritance/m-p/5904702#M1328740</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-08T22:14:51Z</dc:date>
    </item>
  </channel>
</rss>

