<?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: Narrow casting vs wide casting in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/narrow-casting-vs-wide-casting/m-p/1177658#M124733</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Priya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider the below Example for accessing the subclass method from Superclass:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS LCL_SUPERCLASS DEFINITION.&lt;/P&gt;&lt;P&gt;   PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;       METHODS: ABC, XYZ.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS LCL_SUPERCLASS IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD ABC.&lt;/P&gt;&lt;P&gt;   CALL METHOD ME-&amp;gt;XYZ.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD XYZ.&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 LCL_SUBCLASS DEFINITION &lt;/P&gt;&lt;P&gt;       INHERITING FROM LCL_SUPERCLASS.&lt;/P&gt;&lt;P&gt;   PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;      METHODS XYZ REDEFINITION.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS LCL_SUBCLASS IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD XYZ.&lt;/P&gt;&lt;P&gt;      &amp;#133;&amp;#133;&amp;#133;&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;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: O_SUPER TYPE REF TO LCL_SUPERCLASS,&lt;/P&gt;&lt;P&gt;           O_SUB     TYPE REF TO LCL_SUBCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE OBJECT: O_SUPER, O_SUB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD O_SUPER-&amp;gt;ABC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD O_SUB-&amp;gt;ABC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the above example, When you call the superclass method ABC using CALL METHOD O_SUPER-&amp;gt;ABC, as you see in the implementation part of the Method it will inturn call the Superclass method XYZ.&lt;/P&gt;&lt;P&gt;Here ME will point to the instance of the Superclass.&lt;/P&gt;&lt;P&gt;But the CALL METHOD O_SUB-&amp;gt;ABC will call the method ABC ( this is inherited from Superclass to Subclass )and inturn it calls the method XYZ of the SUbclass since ME now points to the object O_SUB of the Subclass.&lt;/P&gt;&lt;P&gt;Hope this is clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nirupamaa.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Feb 2006 06:49:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-02-28T06:49:45Z</dc:date>
    <item>
      <title>Narrow casting vs wide casting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/narrow-casting-vs-wide-casting/m-p/1177657#M124732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have small requriemn..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a super class A and a sub class B.&lt;/P&gt;&lt;P&gt;In both the classes I have a method XYZ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, A has the following methods&lt;/P&gt;&lt;P&gt;ABC &lt;/P&gt;&lt;P&gt;XYZ&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B has the following methods &lt;/P&gt;&lt;P&gt;XYZ&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have want to access the sub class methods from super class...i.e., in my example...Method XYZ of B class needs to be accessed from method ABC or XYZ or A.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And more over..what is the difference between Narrow Casting and Wide casting?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kalyan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2006 06:27:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/narrow-casting-vs-wide-casting/m-p/1177657#M124732</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-28T06:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: Narrow casting vs wide casting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/narrow-casting-vs-wide-casting/m-p/1177658#M124733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Priya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider the below Example for accessing the subclass method from Superclass:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS LCL_SUPERCLASS DEFINITION.&lt;/P&gt;&lt;P&gt;   PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;       METHODS: ABC, XYZ.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS LCL_SUPERCLASS IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD ABC.&lt;/P&gt;&lt;P&gt;   CALL METHOD ME-&amp;gt;XYZ.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD XYZ.&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 LCL_SUBCLASS DEFINITION &lt;/P&gt;&lt;P&gt;       INHERITING FROM LCL_SUPERCLASS.&lt;/P&gt;&lt;P&gt;   PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;      METHODS XYZ REDEFINITION.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS LCL_SUBCLASS IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD XYZ.&lt;/P&gt;&lt;P&gt;      &amp;#133;&amp;#133;&amp;#133;&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;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: O_SUPER TYPE REF TO LCL_SUPERCLASS,&lt;/P&gt;&lt;P&gt;           O_SUB     TYPE REF TO LCL_SUBCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE OBJECT: O_SUPER, O_SUB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD O_SUPER-&amp;gt;ABC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD O_SUB-&amp;gt;ABC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the above example, When you call the superclass method ABC using CALL METHOD O_SUPER-&amp;gt;ABC, as you see in the implementation part of the Method it will inturn call the Superclass method XYZ.&lt;/P&gt;&lt;P&gt;Here ME will point to the instance of the Superclass.&lt;/P&gt;&lt;P&gt;But the CALL METHOD O_SUB-&amp;gt;ABC will call the method ABC ( this is inherited from Superclass to Subclass )and inturn it calls the method XYZ of the SUbclass since ME now points to the object O_SUB of the Subclass.&lt;/P&gt;&lt;P&gt;Hope this is clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nirupamaa.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2006 06:49:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/narrow-casting-vs-wide-casting/m-p/1177658#M124733</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-28T06:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: Narrow casting vs wide casting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/narrow-casting-vs-wide-casting/m-p/1177659#M124734</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;chk out this link:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="300672"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anjali&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2006 06:55:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/narrow-casting-vs-wide-casting/m-p/1177659#M124734</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-28T06:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Narrow casting vs wide casting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/narrow-casting-vs-wide-casting/m-p/1177660#M124735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;narrow cast is whn u wnt 2 access d redifined methods of parent class in child class or in other wrds whn u assign the instance of sub class 2 d reference of super class..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;widening cast is whn u wnt 2 access d new methods of child class or in other wrds whn u assign the reference of super class to child class.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Nov 2008 20:05:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/narrow-casting-vs-wide-casting/m-p/1177660#M124735</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-02T20:05:19Z</dc:date>
    </item>
  </channel>
</rss>

