<?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: OOPS IN ABAP DOUBT in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/oops-in-abap-doubt/m-p/3568032#M858698</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 developed the code in local class:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       interface I1.&lt;/P&gt;&lt;P&gt; METHODS : CREATE,&lt;/P&gt;&lt;P&gt;           CHANGE,&lt;/P&gt;&lt;P&gt;           DISPLAY .&lt;/P&gt;&lt;P&gt;ENDINTERFACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CLASS cl_customer  DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;   INTERFACES : I1.&lt;/P&gt;&lt;P&gt; ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CLASS cl_customer  IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD I1~CREATE.&lt;/P&gt;&lt;P&gt;   WRITE:/5 'I am CREATE method in c1'.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD I1~CHANGE.&lt;/P&gt;&lt;P&gt;   WRITE:/5 'I am CHANGE method in c1'.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD I1~DISPLAY.&lt;/P&gt;&lt;P&gt;   WRITE:/5 'I am DISPLAY method in c1'.&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 CL_SALESORDER DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;   INTERFACES : I1.&lt;/P&gt;&lt;P&gt; ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CLASS CL_SALESORDER IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD I1~CREATE.&lt;/P&gt;&lt;P&gt;   WRITE:/5 'I am CREATE method m1 in c2'.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD I1~CHANGE.&lt;/P&gt;&lt;P&gt;   WRITE:/5 'I am CHANGE method m1 in c2'.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD I1~DISPLAY.&lt;/P&gt;&lt;P&gt;   WRITE:/5 'I am DISPLAY method m1 in c2'.&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; DATA : OREF1 TYPE REF TO CL_CUSTOMER ,&lt;/P&gt;&lt;P&gt;        OREF2 TYPE REF TO CL_SALESORDER ,&lt;/P&gt;&lt;P&gt;        IREF TYPE REF TO I1 .&lt;/P&gt;&lt;P&gt;  CREATE OBJECT : OREF1 ,&lt;/P&gt;&lt;P&gt;                  OREF2 .&lt;/P&gt;&lt;P&gt;  IREF = OREF1.&lt;/P&gt;&lt;P&gt;  CALL METHOD IREF-&amp;gt;CREATE.&lt;/P&gt;&lt;P&gt;  CALL METHOD IREF-&amp;gt;DISPLAY.&lt;/P&gt;&lt;P&gt;  CALL METHOD IREF-&amp;gt;CHANGE.&lt;/P&gt;&lt;P&gt;  IREF = OREF2.&lt;/P&gt;&lt;P&gt;  CALL METHOD IREF-&amp;gt;CREATE.&lt;/P&gt;&lt;P&gt;  CALL METHOD IREF-&amp;gt;DISPLAY.&lt;/P&gt;&lt;P&gt;  CALL METHOD IREF-&amp;gt;CHANGE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is helpful rewards points&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pratap.M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Mar 2008 09:36:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-21T09:36:17Z</dc:date>
    <item>
      <title>OOPS IN ABAP DOUBT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oops-in-abap-doubt/m-p/3568029#M858695</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 have one doubt how to declare an interface to a radio butoon selection functionality(MEANS SEE CODE ),i m here sending the coding  where its poping uup an error as iref_data can not be converted into type o_cuswtomer .herezcl_customer and zcl_salesorder, are classes declared globally in se24 and zif_data is an interface declared in se25(globally)&lt;/P&gt;&lt;P&gt;methods i used in thes calsses are create ,change and display(these three methods i have created)if u find any solution kindly help me me&lt;/P&gt;&lt;P&gt;selection-screen:begin of block b1 with frame title text-030.&lt;/P&gt;&lt;P&gt;parameter: rb_cus radiobutton group r1,&lt;/P&gt;&lt;P&gt;           rb_order radiobutton group r1.&lt;/P&gt;&lt;P&gt;selection-screen:end of block b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen:begin of block b2 with frame title text-030.&lt;/P&gt;&lt;P&gt;parameters:rb_crea radiobutton group g1,&lt;/P&gt;&lt;P&gt;           rb_chan radiobutton group g1,&lt;/P&gt;&lt;P&gt;           rb_dis radiobutton group g1.&lt;/P&gt;&lt;P&gt;selection-screen:end of block b2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*interface declaration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INTERFACE zif_data.&lt;/P&gt;&lt;P&gt;  methods:create,&lt;/P&gt;&lt;P&gt;          change,&lt;/P&gt;&lt;P&gt;          display.&lt;/P&gt;&lt;P&gt;endinterface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*refrence variables.&lt;/P&gt;&lt;P&gt;data:o_customer type ref to zcl_customer,&lt;/P&gt;&lt;P&gt;     o_sorder type ref to zcl_salesorder,&lt;/P&gt;&lt;P&gt;     iref_data TYPE REF TO  zif_data.&lt;/P&gt;&lt;P&gt;***************&lt;STRONG&gt;selection-criteria&lt;/STRONG&gt;****************&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;if rb_cus = 'X'.&lt;/P&gt;&lt;P&gt; iref_data = o_customer.&lt;/P&gt;&lt;P&gt;    elseif&lt;/P&gt;&lt;P&gt;   rb_order = 'X'.&lt;/P&gt;&lt;P&gt;  iref_data = o_sorder.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if rb_crea = 'X'.&lt;/P&gt;&lt;P&gt; call method iref_data-&amp;gt;create.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; elseif&lt;/P&gt;&lt;P&gt; rb_chan = 'X'.&lt;/P&gt;&lt;P&gt; call method iref_data-&amp;gt; change.&lt;/P&gt;&lt;P&gt; elseif&lt;/P&gt;&lt;P&gt; rb_dis = 'X'.&lt;/P&gt;&lt;P&gt; call method iref_data-&amp;gt; display.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;end-of-selection.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Mar 2008 11:52:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oops-in-abap-doubt/m-p/3568029#M858695</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-19T11:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: OOPS IN ABAP DOUBT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oops-in-abap-doubt/m-p/3568030#M858696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Raj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is because iref_data and o_customer / o_salesorder are two totally different 'objects'. You probably want to implement the interface in both classes(add ZIF_DATA as an interface on the interface tab of the class) and use the display and change method of the interface, or not?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming, zcl_customer and zcl_salesorder are classes that can be instantiated. If so, I don't see in your coding that you do (CREATE OBJECT o_customer / o_salesorder).  Meaning, when trying the call the interface method (create, change, display, or whatever method this interface has) through the instances of the classes, you will get a short dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please, explain more about how and what exactly it is you want to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I'm not wrong, than you probably want something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Implement interface in both classes (interface tab). Now you can use the methods of the interface via the instances of the class. I guess, both zcl_customer and zcl_salesorder can be instantiated (create an instance via CREATE OBJECT o_customer, which will call the constructor method of the class).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You now have an instance of the class, meaning you can call an interface method as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method o_customer-&amp;gt;zif_data~display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Micky.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Mar 2008 16:22:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oops-in-abap-doubt/m-p/3568030#M858696</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2008-03-20T16:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: OOPS IN ABAP DOUBT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oops-in-abap-doubt/m-p/3568031#M858697</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;First check u have added the  u r interface in two global classes &lt;/P&gt;&lt;P&gt;  zcl_customer  and zcl_salesorder classes in interface tab.&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;Pratap.M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Mar 2008 07:26:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oops-in-abap-doubt/m-p/3568031#M858697</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-21T07:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: OOPS IN ABAP DOUBT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oops-in-abap-doubt/m-p/3568032#M858698</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 developed the code in local class:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       interface I1.&lt;/P&gt;&lt;P&gt; METHODS : CREATE,&lt;/P&gt;&lt;P&gt;           CHANGE,&lt;/P&gt;&lt;P&gt;           DISPLAY .&lt;/P&gt;&lt;P&gt;ENDINTERFACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CLASS cl_customer  DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;   INTERFACES : I1.&lt;/P&gt;&lt;P&gt; ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CLASS cl_customer  IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD I1~CREATE.&lt;/P&gt;&lt;P&gt;   WRITE:/5 'I am CREATE method in c1'.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD I1~CHANGE.&lt;/P&gt;&lt;P&gt;   WRITE:/5 'I am CHANGE method in c1'.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD I1~DISPLAY.&lt;/P&gt;&lt;P&gt;   WRITE:/5 'I am DISPLAY method in c1'.&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 CL_SALESORDER DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;   INTERFACES : I1.&lt;/P&gt;&lt;P&gt; ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CLASS CL_SALESORDER IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD I1~CREATE.&lt;/P&gt;&lt;P&gt;   WRITE:/5 'I am CREATE method m1 in c2'.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD I1~CHANGE.&lt;/P&gt;&lt;P&gt;   WRITE:/5 'I am CHANGE method m1 in c2'.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD I1~DISPLAY.&lt;/P&gt;&lt;P&gt;   WRITE:/5 'I am DISPLAY method m1 in c2'.&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; DATA : OREF1 TYPE REF TO CL_CUSTOMER ,&lt;/P&gt;&lt;P&gt;        OREF2 TYPE REF TO CL_SALESORDER ,&lt;/P&gt;&lt;P&gt;        IREF TYPE REF TO I1 .&lt;/P&gt;&lt;P&gt;  CREATE OBJECT : OREF1 ,&lt;/P&gt;&lt;P&gt;                  OREF2 .&lt;/P&gt;&lt;P&gt;  IREF = OREF1.&lt;/P&gt;&lt;P&gt;  CALL METHOD IREF-&amp;gt;CREATE.&lt;/P&gt;&lt;P&gt;  CALL METHOD IREF-&amp;gt;DISPLAY.&lt;/P&gt;&lt;P&gt;  CALL METHOD IREF-&amp;gt;CHANGE.&lt;/P&gt;&lt;P&gt;  IREF = OREF2.&lt;/P&gt;&lt;P&gt;  CALL METHOD IREF-&amp;gt;CREATE.&lt;/P&gt;&lt;P&gt;  CALL METHOD IREF-&amp;gt;DISPLAY.&lt;/P&gt;&lt;P&gt;  CALL METHOD IREF-&amp;gt;CHANGE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is helpful rewards points&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pratap.M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Mar 2008 09:36:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oops-in-abap-doubt/m-p/3568032#M858698</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-21T09:36:17Z</dc:date>
    </item>
  </channel>
</rss>

