<?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: interfaces. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces/m-p/2473995#M556695</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;for interfaces&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interfaces are independent structures that allow you to enhance the class-specific public points of contact by implementing them in classes. &lt;/P&gt;&lt;P&gt;Interfaces can be defined globally in the R/3 repository or locally in ABAP program&lt;/P&gt;&lt;P&gt;Can define exactly same components in Interfaces as in Classes&lt;/P&gt;&lt;P&gt;Unlike classes, Interfaces do not have instances, instead they are implemented by classes&lt;/P&gt;&lt;P&gt;Implemented using INTERFACES statement in the declaration part of the class&lt;/P&gt;&lt;P&gt;INTERFACES statement must be included in the PUBLIC SECTION of the class&lt;/P&gt;&lt;P&gt;Different classes that implement the same interface can all be addressed in the same way.&lt;/P&gt;&lt;P&gt;Interface references allow users to address different classes in the same manner. &lt;/P&gt;&lt;P&gt;Interfaces can also be nested.&lt;/P&gt;&lt;P&gt;      Interfaces are the basis for polymorphism in classes, because they allow a single interface method to behave differently in different classes.&lt;/P&gt;&lt;P&gt;If an interface is implemented in the class, the interface components are added in the public section of the class.&lt;/P&gt;&lt;P&gt;A component comp of an interface intf, implemented in a class, becomes a fully-fledged member of that class, with the name intf~comp. &lt;/P&gt;&lt;P&gt;Classes that implement interfaces must implement all of their methods. &lt;/P&gt;&lt;P&gt;     METHOD intf~meth.&lt;/P&gt;&lt;P&gt;     &amp;#133;&lt;/P&gt;&lt;P&gt;     ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interfaces allow you to use different classes in a uniform way (polymorphism). &lt;/P&gt;&lt;P&gt;Interface References :&lt;/P&gt;&lt;P&gt;Creating Interface Reference Variables&lt;/P&gt;&lt;P&gt;      DATA obj TYPE REF TO intf.&lt;/P&gt;&lt;P&gt;Using this reference variable, you can access any of the components defined in the interface &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nested Interfaces&lt;/P&gt;&lt;P&gt;Interface can include one or more interfaces as components, which can contain interfaces themselves.&lt;/P&gt;&lt;P&gt;Compound Interface : It includes other interface as its component.&lt;/P&gt;&lt;P&gt;Elementary Interface : It does not include any interface as a component.&lt;/P&gt;&lt;P&gt;All interface components of a compound interface have the same level&lt;/P&gt;&lt;P&gt;A component interface exists only once even if it is used once more as a component of another component interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aliases : It can be used to assign alias names to the components of component interfaces, thus making them visible within the interface definition.&lt;/P&gt;&lt;P&gt;              ALIASES &amp;lt;alias name&amp;gt; FOR intf~comp.&lt;/P&gt;&lt;P&gt;Where, intf  = interface name and comp = Component name&lt;/P&gt;&lt;P&gt;Accessing Objects using Interface References:&lt;/P&gt;&lt;P&gt;It is also possible to directly generate an object to which the interface reference&lt;/P&gt;&lt;P&gt;      variable points initially. In this case, the TYPE addition of the statement CREATE OBJECT must be used to specify a class that implements the interface.               CREATE OBJECT iref TYPE class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the interface intf contains an attribute attr and an instance method meth, you can address them as follows: &lt;/P&gt;&lt;P&gt;Using the class reference variable: &lt;/P&gt;&lt;P&gt;Accessing an attribute attr: cref-&amp;gt;intf~attr &lt;/P&gt;&lt;P&gt;Calling a method meth: CALL METHOD cref-&amp;gt;intf~meth &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the interface reference variable:&lt;/P&gt;&lt;P&gt; Accessing an attribute attr: iref-&amp;gt;attr &lt;/P&gt;&lt;P&gt;Calling a method meth: CALL METHOD iref-&amp;gt;meth &lt;/P&gt;&lt;P&gt;Accessing Static Components of Interfaces:&lt;/P&gt;&lt;P&gt;Use the name of the interface to access constants within an interface.  &lt;/P&gt;&lt;P&gt;Accessing a constant const: intf=&amp;gt;const.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To access the other static components of an interface, use an object reference or the class class that is implementing the interface.  &lt;/P&gt;&lt;P&gt;Accessing a static attribute attr: class=&amp;gt;intf~attr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calling a static method meth: CALL METHOD class=&amp;gt;intf~meth. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt; an interface is implemented with the method add_employee. Note that the interface is only implemented in the superclass ( The INTERFACE stament), but also used in the subclasses. &lt;/P&gt;&lt;P&gt;The interface in the example only contains a method, but an iterface can also contain attrbutes, constants, types and alias names.&lt;/P&gt;&lt;P&gt;REPORT zbc404_hf_events_3 .&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      INTERFACE lif_employee&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Super class LCL_CompanyEmployees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;    METHODS:&lt;/P&gt;&lt;P&gt;      constructor,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     add_employee      "Removed&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;      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;P&gt;*-- CLASS LCL_CompanyEmployees IMPLEMENTATION&lt;/P&gt;&lt;P&gt;CLASS lcl_company_employees IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;P&gt;    no_of_employees = no_of_employees + 1.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD lif_employee~add_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Adds a new employee to the list of employees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_employee TYPE t_employee.&lt;/P&gt;&lt;P&gt;    l_employee-no = im_no.&lt;/P&gt;&lt;P&gt;    l_employee-name = im_name.&lt;/P&gt;&lt;P&gt;    l_employee-wage = im_wage.&lt;/P&gt;&lt;P&gt;    APPEND l_employee TO i_employee_list.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_employee_list.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Displays all employees and there wage&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_employee TYPE t_employee.&lt;/P&gt;&lt;P&gt;    WRITE: / 'List of Employees'.&lt;/P&gt;&lt;P&gt;    LOOP AT i_employee_list INTO l_employee.&lt;/P&gt;&lt;P&gt;      WRITE: / l_employee-no, l_employee-name, l_employee-wage.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_no_of_employees.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Displays total number of employees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    SKIP 3.&lt;/P&gt;&lt;P&gt;    WRITE: / 'Total number of employees:', no_of_employees.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sub class LCL_BlueCollar_Employee&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_bluecollar_employee DEFINITION&lt;/P&gt;&lt;P&gt;          INHERITING FROM lcl_company_employees.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;        constructor&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_hours          TYPE i&lt;/P&gt;&lt;P&gt;                    im_hourly_payment TYPE i,&lt;/P&gt;&lt;P&gt;         lif_employee~add_employee REDEFINITION..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA:no             TYPE i,&lt;/P&gt;&lt;P&gt;         name           TYPE string,&lt;/P&gt;&lt;P&gt;         hours          TYPE i,&lt;/P&gt;&lt;P&gt;         hourly_payment TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*---- CLASS LCL_BlueCollar_Employee IMPLEMENTATION&lt;/P&gt;&lt;P&gt;CLASS lcl_bluecollar_employee IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  The superclass constructor method must be called from the subclass&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  constructor method&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;constructor.&lt;/P&gt;&lt;P&gt;    no = im_no.&lt;/P&gt;&lt;P&gt;    name = im_name.&lt;/P&gt;&lt;P&gt;    hours = im_hours.&lt;/P&gt;&lt;P&gt;    hourly_payment = im_hourly_payment.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD lif_employee~add_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Calculate wage an call the superclass method add_employee to add&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  the employee to the employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_wage TYPE i.&lt;/P&gt;&lt;P&gt;    l_wage = hours * hourly_payment.&lt;/P&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;lif_employee~add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no = no&lt;/P&gt;&lt;P&gt;                im_name = name&lt;/P&gt;&lt;P&gt;                im_wage = l_wage.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sub class LCL_WhiteCollar_Employee&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_whitecollar_employee DEFINITION&lt;/P&gt;&lt;P&gt;    INHERITING FROM lcl_company_employees.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;        constructor&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_monthly_salary     TYPE i&lt;/P&gt;&lt;P&gt;                    im_monthly_deductions TYPE i,&lt;/P&gt;&lt;P&gt;         lif_employee~add_employee REDEFINITION.&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA:&lt;/P&gt;&lt;P&gt;      no                    TYPE i,&lt;/P&gt;&lt;P&gt;      name                  TYPE string,&lt;/P&gt;&lt;P&gt;      monthly_salary        TYPE i,&lt;/P&gt;&lt;P&gt;      monthly_deductions    TYPE i.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*---- CLASS LCL_WhiteCollar_Employee IMPLEMENTATION&lt;/P&gt;&lt;P&gt;CLASS lcl_whitecollar_employee IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  The superclass constructor method must be called from the subclass&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  constructor method&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;constructor.&lt;/P&gt;&lt;P&gt;    no = im_no.&lt;/P&gt;&lt;P&gt;    name = im_name.&lt;/P&gt;&lt;P&gt;    monthly_salary = im_monthly_salary.&lt;/P&gt;&lt;P&gt;    monthly_deductions = im_monthly_deductions.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD lif_employee~add_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Calculate wage an call the superclass method add_employee to add&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  the employee to the employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_wage TYPE i.&lt;/P&gt;&lt;P&gt;    l_wage = monthly_salary - monthly_deductions.&lt;/P&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;lif_employee~add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no = no&lt;/P&gt;&lt;P&gt;                im_name = name&lt;/P&gt;&lt;P&gt;                im_wage = l_wage.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;R E P O R T&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Object references&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  o_bluecollar_employee1  TYPE REF TO lcl_bluecollar_employee,&lt;/P&gt;&lt;P&gt;  o_whitecollar_employee1 TYPE REF TO lcl_whitecollar_employee.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create bluecollar employee obeject&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT o_bluecollar_employee1&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Gylle Karen'&lt;/P&gt;&lt;P&gt;                im_hours = 38&lt;/P&gt;&lt;P&gt;                im_hourly_payment = 75.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add bluecollar employee to employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_bluecollar_employee1-&amp;gt;lif_employee~add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Karen Johnson'&lt;/P&gt;&lt;P&gt;                im_wage = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create whitecollar employee obeject&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT o_whitecollar_employee1&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 2&lt;/P&gt;&lt;P&gt;                im_name  = 'John Dickens'&lt;/P&gt;&lt;P&gt;                im_monthly_salary = 10000&lt;/P&gt;&lt;P&gt;                im_monthly_deductions = 2500.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add bluecollar employee to employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;lif_employee~add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Gylle Karen'&lt;/P&gt;&lt;P&gt;                im_wage = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display employee list and number of employees. Note that the result&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;will be the same when called from o_whitecollar_employee1 or&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;o_bluecolarcollar_employee1, because the methods are defined&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;as static (CLASS-METHODS)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;display_employee_list.&lt;/P&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;display_no_of_employees.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Sudha Rani Pathuri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jun 2007 04:47:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-29T04:47:29Z</dc:date>
    <item>
      <title>interfaces.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces/m-p/2473994#M556694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;what is mean by interfaces oops ? explain in detail.Give some example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ashok kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 04:43:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces/m-p/2473994#M556694</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T04:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: interfaces.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces/m-p/2473995#M556695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;for interfaces&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interfaces are independent structures that allow you to enhance the class-specific public points of contact by implementing them in classes. &lt;/P&gt;&lt;P&gt;Interfaces can be defined globally in the R/3 repository or locally in ABAP program&lt;/P&gt;&lt;P&gt;Can define exactly same components in Interfaces as in Classes&lt;/P&gt;&lt;P&gt;Unlike classes, Interfaces do not have instances, instead they are implemented by classes&lt;/P&gt;&lt;P&gt;Implemented using INTERFACES statement in the declaration part of the class&lt;/P&gt;&lt;P&gt;INTERFACES statement must be included in the PUBLIC SECTION of the class&lt;/P&gt;&lt;P&gt;Different classes that implement the same interface can all be addressed in the same way.&lt;/P&gt;&lt;P&gt;Interface references allow users to address different classes in the same manner. &lt;/P&gt;&lt;P&gt;Interfaces can also be nested.&lt;/P&gt;&lt;P&gt;      Interfaces are the basis for polymorphism in classes, because they allow a single interface method to behave differently in different classes.&lt;/P&gt;&lt;P&gt;If an interface is implemented in the class, the interface components are added in the public section of the class.&lt;/P&gt;&lt;P&gt;A component comp of an interface intf, implemented in a class, becomes a fully-fledged member of that class, with the name intf~comp. &lt;/P&gt;&lt;P&gt;Classes that implement interfaces must implement all of their methods. &lt;/P&gt;&lt;P&gt;     METHOD intf~meth.&lt;/P&gt;&lt;P&gt;     &amp;#133;&lt;/P&gt;&lt;P&gt;     ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interfaces allow you to use different classes in a uniform way (polymorphism). &lt;/P&gt;&lt;P&gt;Interface References :&lt;/P&gt;&lt;P&gt;Creating Interface Reference Variables&lt;/P&gt;&lt;P&gt;      DATA obj TYPE REF TO intf.&lt;/P&gt;&lt;P&gt;Using this reference variable, you can access any of the components defined in the interface &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nested Interfaces&lt;/P&gt;&lt;P&gt;Interface can include one or more interfaces as components, which can contain interfaces themselves.&lt;/P&gt;&lt;P&gt;Compound Interface : It includes other interface as its component.&lt;/P&gt;&lt;P&gt;Elementary Interface : It does not include any interface as a component.&lt;/P&gt;&lt;P&gt;All interface components of a compound interface have the same level&lt;/P&gt;&lt;P&gt;A component interface exists only once even if it is used once more as a component of another component interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aliases : It can be used to assign alias names to the components of component interfaces, thus making them visible within the interface definition.&lt;/P&gt;&lt;P&gt;              ALIASES &amp;lt;alias name&amp;gt; FOR intf~comp.&lt;/P&gt;&lt;P&gt;Where, intf  = interface name and comp = Component name&lt;/P&gt;&lt;P&gt;Accessing Objects using Interface References:&lt;/P&gt;&lt;P&gt;It is also possible to directly generate an object to which the interface reference&lt;/P&gt;&lt;P&gt;      variable points initially. In this case, the TYPE addition of the statement CREATE OBJECT must be used to specify a class that implements the interface.               CREATE OBJECT iref TYPE class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the interface intf contains an attribute attr and an instance method meth, you can address them as follows: &lt;/P&gt;&lt;P&gt;Using the class reference variable: &lt;/P&gt;&lt;P&gt;Accessing an attribute attr: cref-&amp;gt;intf~attr &lt;/P&gt;&lt;P&gt;Calling a method meth: CALL METHOD cref-&amp;gt;intf~meth &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the interface reference variable:&lt;/P&gt;&lt;P&gt; Accessing an attribute attr: iref-&amp;gt;attr &lt;/P&gt;&lt;P&gt;Calling a method meth: CALL METHOD iref-&amp;gt;meth &lt;/P&gt;&lt;P&gt;Accessing Static Components of Interfaces:&lt;/P&gt;&lt;P&gt;Use the name of the interface to access constants within an interface.  &lt;/P&gt;&lt;P&gt;Accessing a constant const: intf=&amp;gt;const.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To access the other static components of an interface, use an object reference or the class class that is implementing the interface.  &lt;/P&gt;&lt;P&gt;Accessing a static attribute attr: class=&amp;gt;intf~attr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calling a static method meth: CALL METHOD class=&amp;gt;intf~meth. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt; an interface is implemented with the method add_employee. Note that the interface is only implemented in the superclass ( The INTERFACE stament), but also used in the subclasses. &lt;/P&gt;&lt;P&gt;The interface in the example only contains a method, but an iterface can also contain attrbutes, constants, types and alias names.&lt;/P&gt;&lt;P&gt;REPORT zbc404_hf_events_3 .&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      INTERFACE lif_employee&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Super class LCL_CompanyEmployees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;    METHODS:&lt;/P&gt;&lt;P&gt;      constructor,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     add_employee      "Removed&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;      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;P&gt;*-- CLASS LCL_CompanyEmployees IMPLEMENTATION&lt;/P&gt;&lt;P&gt;CLASS lcl_company_employees IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;P&gt;    no_of_employees = no_of_employees + 1.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD lif_employee~add_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Adds a new employee to the list of employees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_employee TYPE t_employee.&lt;/P&gt;&lt;P&gt;    l_employee-no = im_no.&lt;/P&gt;&lt;P&gt;    l_employee-name = im_name.&lt;/P&gt;&lt;P&gt;    l_employee-wage = im_wage.&lt;/P&gt;&lt;P&gt;    APPEND l_employee TO i_employee_list.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_employee_list.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Displays all employees and there wage&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_employee TYPE t_employee.&lt;/P&gt;&lt;P&gt;    WRITE: / 'List of Employees'.&lt;/P&gt;&lt;P&gt;    LOOP AT i_employee_list INTO l_employee.&lt;/P&gt;&lt;P&gt;      WRITE: / l_employee-no, l_employee-name, l_employee-wage.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_no_of_employees.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Displays total number of employees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    SKIP 3.&lt;/P&gt;&lt;P&gt;    WRITE: / 'Total number of employees:', no_of_employees.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sub class LCL_BlueCollar_Employee&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_bluecollar_employee DEFINITION&lt;/P&gt;&lt;P&gt;          INHERITING FROM lcl_company_employees.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;        constructor&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_hours          TYPE i&lt;/P&gt;&lt;P&gt;                    im_hourly_payment TYPE i,&lt;/P&gt;&lt;P&gt;         lif_employee~add_employee REDEFINITION..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA:no             TYPE i,&lt;/P&gt;&lt;P&gt;         name           TYPE string,&lt;/P&gt;&lt;P&gt;         hours          TYPE i,&lt;/P&gt;&lt;P&gt;         hourly_payment TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*---- CLASS LCL_BlueCollar_Employee IMPLEMENTATION&lt;/P&gt;&lt;P&gt;CLASS lcl_bluecollar_employee IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  The superclass constructor method must be called from the subclass&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  constructor method&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;constructor.&lt;/P&gt;&lt;P&gt;    no = im_no.&lt;/P&gt;&lt;P&gt;    name = im_name.&lt;/P&gt;&lt;P&gt;    hours = im_hours.&lt;/P&gt;&lt;P&gt;    hourly_payment = im_hourly_payment.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD lif_employee~add_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Calculate wage an call the superclass method add_employee to add&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  the employee to the employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_wage TYPE i.&lt;/P&gt;&lt;P&gt;    l_wage = hours * hourly_payment.&lt;/P&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;lif_employee~add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no = no&lt;/P&gt;&lt;P&gt;                im_name = name&lt;/P&gt;&lt;P&gt;                im_wage = l_wage.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sub class LCL_WhiteCollar_Employee&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_whitecollar_employee DEFINITION&lt;/P&gt;&lt;P&gt;    INHERITING FROM lcl_company_employees.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;        constructor&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_monthly_salary     TYPE i&lt;/P&gt;&lt;P&gt;                    im_monthly_deductions TYPE i,&lt;/P&gt;&lt;P&gt;         lif_employee~add_employee REDEFINITION.&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA:&lt;/P&gt;&lt;P&gt;      no                    TYPE i,&lt;/P&gt;&lt;P&gt;      name                  TYPE string,&lt;/P&gt;&lt;P&gt;      monthly_salary        TYPE i,&lt;/P&gt;&lt;P&gt;      monthly_deductions    TYPE i.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*---- CLASS LCL_WhiteCollar_Employee IMPLEMENTATION&lt;/P&gt;&lt;P&gt;CLASS lcl_whitecollar_employee IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  The superclass constructor method must be called from the subclass&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  constructor method&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;constructor.&lt;/P&gt;&lt;P&gt;    no = im_no.&lt;/P&gt;&lt;P&gt;    name = im_name.&lt;/P&gt;&lt;P&gt;    monthly_salary = im_monthly_salary.&lt;/P&gt;&lt;P&gt;    monthly_deductions = im_monthly_deductions.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD lif_employee~add_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Calculate wage an call the superclass method add_employee to add&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  the employee to the employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_wage TYPE i.&lt;/P&gt;&lt;P&gt;    l_wage = monthly_salary - monthly_deductions.&lt;/P&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;lif_employee~add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no = no&lt;/P&gt;&lt;P&gt;                im_name = name&lt;/P&gt;&lt;P&gt;                im_wage = l_wage.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;R E P O R T&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Object references&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  o_bluecollar_employee1  TYPE REF TO lcl_bluecollar_employee,&lt;/P&gt;&lt;P&gt;  o_whitecollar_employee1 TYPE REF TO lcl_whitecollar_employee.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create bluecollar employee obeject&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT o_bluecollar_employee1&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Gylle Karen'&lt;/P&gt;&lt;P&gt;                im_hours = 38&lt;/P&gt;&lt;P&gt;                im_hourly_payment = 75.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add bluecollar employee to employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_bluecollar_employee1-&amp;gt;lif_employee~add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Karen Johnson'&lt;/P&gt;&lt;P&gt;                im_wage = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create whitecollar employee obeject&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT o_whitecollar_employee1&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 2&lt;/P&gt;&lt;P&gt;                im_name  = 'John Dickens'&lt;/P&gt;&lt;P&gt;                im_monthly_salary = 10000&lt;/P&gt;&lt;P&gt;                im_monthly_deductions = 2500.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add bluecollar employee to employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;lif_employee~add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Gylle Karen'&lt;/P&gt;&lt;P&gt;                im_wage = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display employee list and number of employees. Note that the result&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;will be the same when called from o_whitecollar_employee1 or&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;o_bluecolarcollar_employee1, because the methods are defined&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;as static (CLASS-METHODS)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;display_employee_list.&lt;/P&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;display_no_of_employees.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Sudha Rani Pathuri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 04:47:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces/m-p/2473995#M556695</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T04:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: interfaces.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces/m-p/2473996#M556696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ashok,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer the foll. link .. it ll take u thru the basics of OO-ABAP as well as Interface&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/object" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/object&lt;/A&gt;&lt;EM&gt;Oriented&lt;/EM&gt;ABAP+(OO-ABAP)&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 04:47:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces/m-p/2473996#M556696</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T04:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: interfaces.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces/m-p/2473997#M556697</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;Give me your mail id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Anitha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 04:50:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces/m-p/2473997#M556697</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T04:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: interfaces.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces/m-p/2473998#M556698</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;Interfaces are similar to classes where in you will not have any METHOD implementations. You will only have Attributes and METHOD definitions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interfaces have to be implemented by Classes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The use is that One interface can be implemented by any number of classes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SO using an interface reference you can work on MANY TYPES OF CLASS  objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: intf type ref to Interface1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose Class1 class2 ... classn are implemnting this interface1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then we can&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;intf = clas1_obj.&lt;/P&gt;&lt;P&gt;intf = clas2_obj.&lt;/P&gt;&lt;P&gt;intf = clasn_obj.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SO one reference can be used to work with many objects of different classes.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 04:51:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces/m-p/2473998#M556698</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2007-06-29T04:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: interfaces.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces/m-p/2473999#M556699</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;      ashuvalal@gmail.com&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ashok&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 04:57:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces/m-p/2473999#M556699</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T04:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: interfaces.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces/m-p/2474000#M556700</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;Check your mail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Anitha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 05:02:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces/m-p/2474000#M556700</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T05:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: interfaces.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces/m-p/2474001#M556701</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;interface concepts are related to OOP concepts in abap.. in general interface conatin only the definition of a method..and the implemenation is done in the class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check out this code..copy and paste it in se38..or check with abapdocu tcode..&lt;/P&gt;&lt;P&gt;REPORT demo_interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INTERFACE status.&lt;/P&gt;&lt;P&gt;  METHODS write.&lt;/P&gt;&lt;P&gt;ENDINTERFACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS counter DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    INTERFACES status.&lt;/P&gt;&lt;P&gt;    METHODS increment.&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA count TYPE i.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS counter IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD status~write.&lt;/P&gt;&lt;P&gt;    WRITE: / 'Count in counter is', count.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD increment.&lt;/P&gt;&lt;P&gt;    ADD 1 TO count.&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 bicycle DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    INTERFACES status.&lt;/P&gt;&lt;P&gt;    METHODS drive.&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA speed TYPE i.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS bicycle IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD status~write.&lt;/P&gt;&lt;P&gt;    WRITE: / 'Speed of bicycle is', speed.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD drive.&lt;/P&gt;&lt;P&gt;    ADD 10 TO speed.&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;DATA: count  TYPE REF TO counter,&lt;/P&gt;&lt;P&gt;      bike   TYPE REF TO bicycle,&lt;/P&gt;&lt;P&gt;      status TYPE REF TO status,&lt;/P&gt;&lt;P&gt;      status_tab TYPE TABLE OF REF TO status.&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;  CREATE OBJECT: count, bike.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DO 5 TIMES.&lt;/P&gt;&lt;P&gt;    CALL METHOD: count-&amp;gt;increment,&lt;/P&gt;&lt;P&gt;                 bike-&amp;gt;drive.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND: count TO status_tab,&lt;/P&gt;&lt;P&gt;          bike  TO status_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT status_tab INTO status.&lt;/P&gt;&lt;P&gt;    CALL METHOD status-&amp;gt;write.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks &lt;/P&gt;&lt;P&gt;jaideep&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points if it is useful..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 13:33:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces/m-p/2474001#M556701</guid>
      <dc:creator>jaideeps</dc:creator>
      <dc:date>2007-06-29T13:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: interfaces.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces/m-p/2474002#M556702</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;see this example.&lt;/P&gt;&lt;P&gt;REPORT  ZINTERFACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INTERFACE inter1.&lt;/P&gt;&lt;P&gt;  DATA:inter1_num TYPE i.&lt;/P&gt;&lt;P&gt;  METHODS:inter1_meth importing value(number1) type i.&lt;/P&gt;&lt;P&gt;ENDINTERFACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INTERFACE inter2.&lt;/P&gt;&lt;P&gt;  DATA:inter2_num TYPE i.&lt;/P&gt;&lt;P&gt;  METHODS:inter2_meth importing value(number2) type i.&lt;/P&gt;&lt;P&gt;ENDINTERFACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS clas1 DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;  INTERFACES:inter1,inter2.&lt;/P&gt;&lt;P&gt;  DATA:cls_num TYPE i.&lt;/P&gt;&lt;P&gt;  METHODS:cls_meth.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS clas1 IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD inter1~inter1_meth.&lt;/P&gt;&lt;P&gt;    cls_num = number1 + number1.&lt;/P&gt;&lt;P&gt;    inter1~inter1_num = cls_num + cls_num.&lt;/P&gt;&lt;P&gt;    write:/ 'i am from first interface'.&lt;/P&gt;&lt;P&gt;    write:/ number1,/ cls_num,/ inter1~inter1_num.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD inter2~inter2_meth.&lt;/P&gt;&lt;P&gt;    cls_num = number2 + number2 + number2.&lt;/P&gt;&lt;P&gt;    inter2~inter2_num = cls_num + cls_num + cls_num.&lt;/P&gt;&lt;P&gt;    write:/ 'i am from second interface'.&lt;/P&gt;&lt;P&gt;    write:/ number2,/ cls_num,/ inter2~inter2_num.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD cls_meth.&lt;/P&gt;&lt;P&gt;    write:/ 'i am from class'.&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:myinput TYPE i value 20.&lt;/P&gt;&lt;P&gt;DATA:obj TYPE REF TO clas1.&lt;/P&gt;&lt;P&gt;CREATE OBJECT obj.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD obj-&amp;gt;inter1~inter1_meth&lt;/P&gt;&lt;P&gt;exporting number1 = myinput.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD obj-&amp;gt;inter2~inter2_meth&lt;/P&gt;&lt;P&gt;exporting number2 = myinput.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD obj-&amp;gt;cls_meth.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 14:22:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces/m-p/2474002#M556702</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T14:22:26Z</dc:date>
    </item>
  </channel>
</rss>

