<?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: Reg. METHOD redefnition in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-method-redefnition/m-p/7471174#M1555076</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still have the same doubt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the following code, i ahve used the only method DISPLAY in both superclass and subclass. Here if i remove the keyword REDEFINITION from the subclass. I am getting the error as " method DISPLAY as already been declared "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class lc_superclass DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;  METHODS : display.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lc_superclass IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD display.&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 lc_subclass DEFINITION INHERITING FROM lc_superclass.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;  METHODS : display REDEFINITION.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lc_subclass IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD display.&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;Can you please correct if i am wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prabu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Nov 2010 12:22:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-11-16T12:22:33Z</dc:date>
    <item>
      <title>Reg. METHOD redefnition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-method-redefnition/m-p/7471172#M1555074</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;I tried to inherit a subclass from super class. In se38, i created supercalss and subclasses as local classes. Here in subclass, the system was expecting the keyword REDEFINITION while resuing the same method in the subclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when i do the same thing in SE24 for creating a Global Class, the system was not asking to redefine the method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me what could the difference?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prabu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Nov 2010 11:21:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-method-redefnition/m-p/7471172#M1555074</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-16T11:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: Reg. METHOD redefnition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-method-redefnition/m-p/7471173#M1555075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to redefine method only if it has different body (implementation) in the subclass. All the others which have been defined in public section of superclass will stay as they are. So within subclass you can access them too. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In global class the principle is the same. If you go to &lt;EM&gt;cl_gui_alv_grid&lt;/EM&gt; you shall see lots of blue-marked methods which originally comes from some superclass. Double click such method and system will prompt the message saying who is the real owner (who implements the method). The redefinition of certain methods takes place only for choosen ones (as within local classes). To prove that from menu select  &lt;EM&gt;Goto -&amp;gt; Public section&lt;/EM&gt; and search for &lt;STRONG&gt;FREE&lt;/STRONG&gt; method. You shall see that next to its definition there is keyword &lt;EM&gt;REDEFINITION&lt;/EM&gt; . So only this methods which has this addtion will receive their new implementation in the sublcass. They also are no longer blue-marked but become black.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Nov 2010 12:04:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-method-redefnition/m-p/7471173#M1555075</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-11-16T12:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Reg. METHOD redefnition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-method-redefnition/m-p/7471174#M1555076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still have the same doubt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the following code, i ahve used the only method DISPLAY in both superclass and subclass. Here if i remove the keyword REDEFINITION from the subclass. I am getting the error as " method DISPLAY as already been declared "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class lc_superclass DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;  METHODS : display.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lc_superclass IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD display.&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 lc_subclass DEFINITION INHERITING FROM lc_superclass.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;  METHODS : display REDEFINITION.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lc_subclass IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD display.&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;Can you please correct if i am wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prabu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Nov 2010 12:22:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-method-redefnition/m-p/7471174#M1555076</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-16T12:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Reg. METHOD redefnition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-method-redefnition/m-p/7471175#M1555077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;By default method &lt;EM&gt;display&lt;/EM&gt; is available in &lt;EM&gt;lc_subclass&lt;/EM&gt; (as it is defined in public section of superclass). In principle the public section is shared accross class hierarchy (subclass sees superclass's components, but not vice versa). So in your case you can call method &lt;EM&gt;display&lt;/EM&gt; using &lt;EM&gt;subclass&lt;/EM&gt; object reference. So no need to have &lt;EM&gt;METHODS display&lt;/EM&gt; definition nor implementation in the subclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the other hand if you are not satisfied with its implementation all you can do about that is &lt;EM&gt;redefining&lt;/EM&gt; it in the subclass. The keyword &lt;STRONG&gt;REDEFINITION&lt;/STRONG&gt; in this case is a must. When you remove it, the system will try to define &lt;EM&gt;display&lt;/EM&gt; method anew, but as  it already sees its definition (coming from superclass's public section) it doesn't allow you to do so.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In simple words. You must leave &lt;EM&gt;redefinition&lt;/EM&gt; keyword if you use &lt;EM&gt;METHODS display&lt;/EM&gt; within subclass. If implementation is ok then remove sublcass definition at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it is clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Nov 2010 12:33:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-method-redefnition/m-p/7471175#M1555077</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-11-16T12:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: Reg. METHOD redefnition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-method-redefnition/m-p/7471176#M1555078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Once you inherit your Subclass from the Super Class, you would see all the Public and Protected methods in your Super Class. Now to redefine any particular method, place cursor on the method and press the "Redefine" button. This button is available as 3rd last in the same toolbar where you see the buttons for Parameters, exceptions and so on.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To undo the redefinition of any redefined method, you use the button "Undo Redefinition" available next to Redefinition button. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this help: [Extending Subclasses|http://help.sap.com/saphelp_NW70EHP1core/helpdata/en/2f/8bbf7bbb4111d2958600a0c94260a5/frameset.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Nov 2010 15:01:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-method-redefnition/m-p/7471176#M1555078</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2010-11-16T15:01:28Z</dc:date>
    </item>
  </channel>
</rss>

