<?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: regarding interface in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-interface/m-p/3173396#M755108</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in which situation we are going to use interfaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; could u plz explain clearly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Dec 2007 07:20:10 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-18T07:20:10Z</dc:date>
    <item>
      <title>regarding interface</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-interface/m-p/3173393#M755105</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;can we write the interface like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v1 type ref to &amp;lt;interface name&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz rectify this doubt &lt;/P&gt;&lt;P&gt;very urgent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2007 06:30:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-interface/m-p/3173393#M755105</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-18T06:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: regarding interface</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-interface/m-p/3173394#M755106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;*u cant directly create object and u cant implement the methods in the object using interfaces. &lt;/P&gt;&lt;P&gt;*u have declare that interface inside a class and u have to implement all the methods in interface using that class only. &lt;/P&gt;&lt;P&gt;*go thru in this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INTERFACE lif_employee.&lt;/P&gt;&lt;P&gt;  METHODS:&lt;/P&gt;&lt;P&gt;    add_employee&lt;/P&gt;&lt;P&gt;       IMPORTING  im_no   TYPE i&lt;/P&gt;&lt;P&gt;                  im_name TYPE string&lt;/P&gt;&lt;P&gt;                  im_wage TYPE i.&lt;/P&gt;&lt;P&gt;ENDINTERFACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lcl_company_employees DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    INTERFACES lif_employee.&lt;/P&gt;&lt;P&gt;    TYPES:&lt;/P&gt;&lt;P&gt;      BEGIN OF t_employee,&lt;/P&gt;&lt;P&gt;        no  TYPE i,&lt;/P&gt;&lt;P&gt;        name TYPE string,&lt;/P&gt;&lt;P&gt;        wage TYPE i,&lt;/P&gt;&lt;P&gt;     END OF t_employee.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;      constructor,&lt;/P&gt;&lt;P&gt;      display_employee_list,&lt;/P&gt;&lt;P&gt;      display_no_of_employees.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    CLASS-DATA: i_employee_list TYPE TABLE OF t_employee,&lt;/P&gt;&lt;P&gt;                no_of_employees TYPE i.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2007 06:56:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-interface/m-p/3173394#M755106</guid>
      <dc:creator>asik_shameem</dc:creator>
      <dc:date>2007-12-18T06:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: regarding interface</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-interface/m-p/3173395#M755107</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;This program will show the use of interface reference variable and how it can be used to access the components of an interface in a class(implementing that interface). Use of interface reference variable paves the way for polymorphism via interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report ysubdel .&lt;/P&gt;&lt;P&gt;interface i1 .&lt;/P&gt;&lt;P&gt; constants     : c_name(4) type c value 'ABAP'.&lt;/P&gt;&lt;P&gt; data          : inum type i  .&lt;/P&gt;&lt;P&gt; class-data    : cnum type i  .&lt;/P&gt;&lt;P&gt; methods       : m1 .&lt;/P&gt;&lt;P&gt; class-methods : m2.&lt;/P&gt;&lt;P&gt;endinterface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; class c1 definition .&lt;/P&gt;&lt;P&gt;  public section.&lt;/P&gt;&lt;P&gt;   interfaces : I1 data values inum = 5 cnum = 6  .&lt;/P&gt;&lt;P&gt; endclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; class c1 implementation.&lt;/P&gt;&lt;P&gt;  method i1~m1.&lt;/P&gt;&lt;P&gt;   write:/5 'I am m1 in c1'.&lt;/P&gt;&lt;P&gt;  endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  method i1~m2.&lt;/P&gt;&lt;P&gt;   write:/5 'I am class method m2 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; start-of-selection.&lt;/P&gt;&lt;P&gt;  data : iref type ref to i1 ,&lt;/P&gt;&lt;P&gt;         oref type ref to c1 .&lt;/P&gt;&lt;P&gt;   create object : oref.&lt;/P&gt;&lt;P&gt;   write:/5   oref-&amp;gt;i1~inum ,&lt;/P&gt;&lt;P&gt;              oref-&amp;gt;i1~cnum ,&lt;/P&gt;&lt;P&gt;              c1=&amp;gt;i1~cnum   .&lt;/P&gt;&lt;P&gt;   call method : oref-&amp;gt;i1~m1 ,&lt;/P&gt;&lt;P&gt;                 oref-&amp;gt;i1~m2 ,&lt;/P&gt;&lt;P&gt;                 c1=&amp;gt;i1~m2   .&lt;/P&gt;&lt;P&gt;   write:/5 sy-uline .&lt;/P&gt;&lt;P&gt;   iref = oref .&lt;/P&gt;&lt;P&gt;   write:/5   iref-&amp;gt;inum ,&lt;/P&gt;&lt;P&gt;              iref-&amp;gt;cnum ,&lt;/P&gt;&lt;P&gt;              i1=&amp;gt;c_name .&lt;/P&gt;&lt;P&gt;   call method : iref-&amp;gt;m1 ,&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;Omkar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2007 07:08:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-interface/m-p/3173395#M755107</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-18T07:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: regarding interface</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-interface/m-p/3173396#M755108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in which situation we are going to use interfaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; could u plz explain clearly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2007 07:20:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-interface/m-p/3173396#M755108</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-18T07:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: regarding interface</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-interface/m-p/3173397#M755109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Venkat, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I understand you correctly, you want to address objects using Interface references. If thats the case then refer to the documentation below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Addressing Objects Using Interface References&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a class class implements an interface intf, you can use the following assignment between the class reference variable crefand an interface reference irefto make the interface reference in irefpoint to the same object as the class reference in cref:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;iref = cref&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a class class implements an interface intf, you do not need to create a class reference variable cref with reference to the class first in order to create an object of the class class. Instead, you can use the TYPE addition in the CREATE OBJECT statement to create an instance of the class with an interface reference variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CREATE OBJECT iref TYPE class.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This creates an instance of the class classto which the reference in irefpoints.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the interface intf contains an instance attribute attr and an instance method meth, you can address the interface components as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;Using the class reference variable cref:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;·        To access an attribute attr: &lt;STRONG&gt;cref-&amp;gt;intf~at&lt;/STRONG&gt;tr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;·        To call a method meth: CALL METHOD &amp;gt;&amp;gt;&lt;STRONG&gt;cref&amp;gt;intf~meth&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;Using the interface reference variable iref:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;·        To access an attribute attr: iref-&amp;gt;attr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;·        To call a method meth: CALL METHOD iref-&amp;gt;meth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as the static components of interfaces are concerned, you can only use the interface name to access constants: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To access a constant const: intf=&amp;gt;const&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For all other static components of an interface, you can only use object references or the class class that implements the interface:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To access a static attribute attr: class=&amp;gt;intf~attr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To call a static method meth: &lt;STRONG&gt;CALL METHOD class=&amp;gt;intf~meth&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Rajesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please reward points if found helpful.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2007 19:46:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-interface/m-p/3173397#M755109</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-19T19:46:37Z</dc:date>
    </item>
  </channel>
</rss>

