<?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: Using interface in SE24 via inheritance in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-interface-in-se24-via-inheritance/m-p/4318080#M1029052</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi..&lt;/P&gt;&lt;P&gt;I agree with what Uwe said... What  you have done looks completely wrong to me ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I can explain why the syntax error comes .. &lt;/P&gt;&lt;P&gt;That's because from the constructor of the class ZCL1 you are calling the interface method of ZIF1 which is again implemented by class ZCL1 (whose object is under construction) ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Very confusing !!! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you let us know why are doing it like this !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Varun.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Aug 2008 03:59:40 GMT</pubDate>
    <dc:creator>former_member69765</dc:creator>
    <dc:date>2008-08-21T03:59:40Z</dc:date>
    <item>
      <title>Using interface in SE24 via inheritance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-interface-in-se24-via-inheritance/m-p/4318078#M1029050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a class in SE24 (ZCL1) in which I have created an interface (ZIF1) that has a method A (set start parameters).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the class constructor of ZCL1 I am calling that interface by doing:&lt;/P&gt;&lt;P&gt;call method ZIF1~A importing...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I have a second class (ZCL2) that inherits from ZCL1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inside ZCL2, I put the implementation code inside the ZIF1~A method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a program that instantiates and calls ZCL2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue is that I get a dump saying:&lt;/P&gt;&lt;P&gt;You called an interface method that has not been implemented yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am sure that i am missing something but I do not know what...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Itay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2008 14:29:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-interface-in-se24-via-inheritance/m-p/4318078#M1029050</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-20T14:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using interface in SE24 via inheritance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-interface-in-se24-via-inheritance/m-p/4318079#M1029051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Itay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not really sure about the error cause but it is clear that your construct is anything but a mess.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The interface method must be &lt;EM&gt;static&lt;/EM&gt; otherwise you could not call it within the static CLASS_CONSTRUCTOR method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Static method cannot be redefined. Thus, you have to put the coding in ZCL1=&amp;gt;ZIF1~A.&lt;/P&gt;&lt;P&gt;For me it has been impossible to define any coding in ZCL2=&amp;gt;ZIF1~A (redefinition within the sub-class).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2008 19:47:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-interface-in-se24-via-inheritance/m-p/4318079#M1029051</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-08-20T19:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using interface in SE24 via inheritance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-interface-in-se24-via-inheritance/m-p/4318080#M1029052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi..&lt;/P&gt;&lt;P&gt;I agree with what Uwe said... What  you have done looks completely wrong to me ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I can explain why the syntax error comes .. &lt;/P&gt;&lt;P&gt;That's because from the constructor of the class ZCL1 you are calling the interface method of ZIF1 which is again implemented by class ZCL1 (whose object is under construction) ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Very confusing !!! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you let us know why are doing it like this !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Varun.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2008 03:59:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-interface-in-se24-via-inheritance/m-p/4318080#M1029052</guid>
      <dc:creator>former_member69765</dc:creator>
      <dc:date>2008-08-21T03:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using interface in SE24 via inheritance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-interface-in-se24-via-inheritance/m-p/4318081#M1029053</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 think it is a mess... I am trying to do the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one program that is 90% true for few plants.&lt;/P&gt;&lt;P&gt;The core functionality is the same but each plant needs to extend it a bit.&lt;/P&gt;&lt;P&gt;I prefer the main program to be the same for maintenance reasons.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;I would like the core functionality to be in one class while I can put some extensions in an inheritance class that extends the code a bit in a plant specific way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The thing is that the main class handles the logic and I do not want to call anything from the calling program but only from the super class (I want the super class to activate logic from the child class).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the best way to do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Itay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2008 06:25:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-interface-in-se24-via-inheritance/m-p/4318081#M1029053</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-21T06:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using interface in SE24 via inheritance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-interface-in-se24-via-inheritance/m-p/4318082#M1029054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;WEll then that is simple ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to have one Super class (That implements the main functionality and more importantly the common functionality) - Say ZCL_MAIN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You inherit (lets say 2 classes for 2 different plants) - ZCL_CHILD_1 and ZCL_CHILD_2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since in your original post you mentioned about the interface also.. I believe there is an interface ZIF_1 also ... &lt;/P&gt;&lt;P&gt;So let the main class ZCL_MAIN implement it .. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now .. lets say Functionality 1 is implemented in Method M1 (of main class remember ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will now re-define the method M1 for both child classes ... In the redefiniton .. you can call SUPER-&amp;gt;M1 and then your plant specefic code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what is happening here .. When you have plant 1 (implemented by child 1) the (redefined) method M1 of child class 1 is called ... this will call super class method M1 which will have common functionality and then its own specefic logic...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Comming to constructors : Same... Have different constructors for child classes... And in the constructore method call - SUPER-&amp;gt;Constructor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope.. you will understand it.. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2008 06:39:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-interface-in-se24-via-inheritance/m-p/4318082#M1029054</guid>
      <dc:creator>former_member69765</dc:creator>
      <dc:date>2008-08-21T06:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using interface in SE24 via inheritance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-interface-in-se24-via-inheritance/m-p/4318083#M1029055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you say is basically what I did but I have a how to implement the interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I do that from ZCL_MAIN?&lt;/P&gt;&lt;P&gt;what does it mean to implement an interface?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2008 07:01:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-interface-in-se24-via-inheritance/m-p/4318083#M1029055</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-21T07:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Using interface in SE24 via inheritance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-interface-in-se24-via-inheritance/m-p/4318084#M1029056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi... &lt;/P&gt;&lt;P&gt;In your 1st post ... you said.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; I have a class in SE24 (ZCL1) in which I have created an interface (ZIF1) that has a method A &amp;gt;(set start parameters).&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's not the correct way of saying .. we don't create interfaces in class... We implement an interface in a class..&lt;/P&gt;&lt;P&gt;How do we implement : Open your class in SE24 and go to interface tab. Enter the interface name here. That's all ... now your class implements the interface.&lt;/P&gt;&lt;P&gt;This means... now all the methods defined on the itnerface will be implemented in this class..&lt;/P&gt;&lt;P&gt;Meaning... you will write the code for all these methods (of interface) in your class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2008 07:07:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-interface-in-se24-via-inheritance/m-p/4318084#M1029056</guid>
      <dc:creator>former_member69765</dc:creator>
      <dc:date>2008-08-21T07:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using interface in SE24 via inheritance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-interface-in-se24-via-inheritance/m-p/4318085#M1029057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have done what you said some time ago but for some reason it does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a method set_parameters which is called from within the the super constructor.  The set_parameters inside the super clas is empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I redefined it within the child class and put some values in it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I call the inherited class it calls the super and the set_parameters method of the super is called and not the child's.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not know why it is like that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my main issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2008 07:17:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-interface-in-se24-via-inheritance/m-p/4318085#M1029057</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-21T07:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using interface in SE24 via inheritance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-interface-in-se24-via-inheritance/m-p/4318086#M1029058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi..&lt;/P&gt;&lt;P&gt;Well now I have some more understanding about your problem...&lt;/P&gt;&lt;P&gt;I'll try to explain..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ZCL_MAIN - 2 child classes ZCL_CHILD_1 and ZCL_CHILD_2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : lref_obj TYPE REF TO ZCL_MAIN.&lt;/P&gt;&lt;P&gt;CREATE OBJECT lref_obj. --&amp;gt; Constructor of Super class&lt;/P&gt;&lt;P&gt;lref_obj-&amp;gt;M1  --&amp;gt; This will call the method of super class..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : lref_obj TYPE REF TO ZCL_CHILD_1.&lt;/P&gt;&lt;P&gt;CREATE OBJECT lref_obj. --&amp;gt; Constructor of Child class 1&lt;/P&gt;&lt;P&gt;lref_obj-&amp;gt;M1  --&amp;gt; This will call the method of Child class 1..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : lref_obj TYPE REF TO ZCL_CHILD_2.&lt;/P&gt;&lt;P&gt;CREATE OBJECT lref_obj. --&amp;gt; Constructor of Child Class 2&lt;/P&gt;&lt;P&gt;lref_obj-&amp;gt;M1  --&amp;gt; This will call the method of Child class 2..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now comes the real part .. pay special attention.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : lref_obj TYPE REF TO ZCL_MAIN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE OBJECT lref_obj TYPE ZCL_CHILD_1.  --&amp;gt; Constructor of Child class 1&lt;/P&gt;&lt;P&gt;lref_obj-&amp;gt;M1  --&amp;gt; This will call the method of Child class 2 not Super class..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE OBJECT lref_obj TYPE ZCL_CHILD_2. --&amp;gt; Constructor of Child class 2&lt;/P&gt;&lt;P&gt;lref_obj-&amp;gt;M1   --&amp;gt; This will call the method of Child class 2 not Super class..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it is clear now .. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Varun Verma on Aug 21, 2008 12:54 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2008 07:24:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-interface-in-se24-via-inheritance/m-p/4318086#M1029058</guid>
      <dc:creator>former_member69765</dc:creator>
      <dc:date>2008-08-21T07:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using interface in SE24 via inheritance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-interface-in-se24-via-inheritance/m-p/4318087#M1029059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Itay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let me try to explain why it is so.&lt;/P&gt;&lt;P&gt;You have a superclass, its constructor and its set_parameter method.&lt;/P&gt;&lt;P&gt;Then you have a subclass, its constructor and the superclass' set_parameter method redefined here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you instantiate the subclass, which leads to the subclass constructor being called, which in turn calls the superclass constructor. Here in the superclass constructor you have made a call to the set_parameter method. So, the set_parameter method of the &lt;U&gt;superclass&lt;/U&gt; is executed (you cant expect the superclass constructor to call the subclass method because it has no knowledge of which subclasses of it exist, or may exist in future. The superclass only knows itself).&lt;/P&gt;&lt;P&gt;So then the control goes back to the subclass constructor (which I believe you have kept empty) and so no further call to the subclass' set_parameter is made.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your case, you can make a call to set_parameter within the subclass constructor.&lt;/P&gt;&lt;P&gt;You may rightly argue on this not being a good reusable design. In this case I would suggest you to have a rethink on whether you can put the generic logic of set_parameter in the superclass itself, rather than keeping it empty. I really dont know your situation and cant suggest which is right for you, but your problem sounded to me as something that can be addressed by the generic set_parameter method of the superclass.&lt;/P&gt;&lt;P&gt;If not, you can simply try what I said in the beginning - make a call to set_parameter within the subclass constructor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would like to hear what you did next...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2008 19:30:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-interface-in-se24-via-inheritance/m-p/4318087#M1029059</guid>
      <dc:creator>former_member509072</dc:creator>
      <dc:date>2008-08-22T19:30:10Z</dc:date>
    </item>
  </channel>
</rss>

