<?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: Importing object parameter to method in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/importing-object-parameter-to-method/m-p/11561438#M1937359</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To add some more to this: If your parameter is TYPE REF TO some_interface, it accepts any object implementing that interface. It does not care about what or how many other interfaces the class implements.&lt;/P&gt;&lt;P&gt;Implementing several interfaces in one class is not what typically is called multiple inheritance, as the linked article suggests. There are many reasons to implement several interfaces in a class. Maybe have a look at the &lt;A href="https://en.wikipedia.org/wiki/Interface_segregation_principle"&gt;interface segregation principle&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind regards,&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Mar 2016 10:10:50 GMT</pubDate>
    <dc:creator>ThomasKruegl</dc:creator>
    <dc:date>2016-03-04T10:10:50Z</dc:date>
    <item>
      <title>Importing object parameter to method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/importing-object-parameter-to-method/m-p/11561436#M1937357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abapers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i was practicing local interface in report i got sample code from Zevolving, please look the code once ( &lt;A href="http://zevolving.com/2012/05/abap-objects-achieve-multiple-inheritance-using-interfaces/" title="http://zevolving.com/2012/05/abap-objects-achieve-multiple-inheritance-using-interfaces/"&gt; ABAP Objects - Achieve Multiple Inheritance using Interfaces ). &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if we said importing parameter is character it should accept only character type, same like that if we declared the importing parameter is &lt;SPAN class="kw4" style="color: blue !important;"&gt;TYPE&lt;/SPAN&gt; &lt;SPAN class="kw9" style="color: blue !important;"&gt;REF TO&lt;/SPAN&gt; lif_data it should accept only the object which is reference of lif_data, am i right ???.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here the piece of sample code(&amp;nbsp; &lt;A href="http://zevolving.com/2012/05/abap-objects-achieve-multiple-inheritance-using-interfaces/"&gt;Here_Complete_Code&lt;/A&gt; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="kw3" style="color: blue !important;"&gt;CLASS&lt;/SPAN&gt; lcl_main &lt;SPAN class="kw4" style="color: blue !important;"&gt;DEFINITION&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN class="kw8" style="color: blue !important;"&gt;PUBLIC SECTION&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="kw3" style="color: blue !important;"&gt;CLASS-METHODS&lt;/SPAN&gt;: select_Data &lt;SPAN class="kw4" style="color: blue !important;"&gt;IMPORTING&lt;/SPAN&gt; io_Data &lt;SPAN class="kw4" style="color: blue !important;"&gt;TYPE&lt;/SPAN&gt; &lt;SPAN class="kw9" style="color: blue !important;"&gt;REF TO&lt;/SPAN&gt; lif_data,&lt;/P&gt;&lt;P&gt;&amp;nbsp; write_Data&amp;nbsp; &lt;SPAN class="kw4" style="color: blue !important;"&gt;IMPORTING&lt;/SPAN&gt; io_output &lt;SPAN class="kw4" style="color: blue !important;"&gt;TYPE&lt;/SPAN&gt; &lt;SPAN class="kw9" style="color: blue !important;"&gt;REF TO&lt;/SPAN&gt; lif_output.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="kw3" style="color: blue !important;"&gt;ENDCLASS&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="kw3" style="color: blue !important;"&gt;START-OF-SELECTION&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="kw2" style="color: blue !important;"&gt;&amp;nbsp; DATA&lt;/SPAN&gt;: lo_report &lt;SPAN class="kw4" style="color: blue !important;"&gt;TYPE&lt;/SPAN&gt; &lt;SPAN class="kw9" style="color: blue !important;"&gt;REF TO&lt;/SPAN&gt; lcl_summary.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN class="kw8" style="color: blue !important;"&gt;CREATE OBJECT&lt;/SPAN&gt; lo_report.&lt;/P&gt;&lt;P&gt;&amp;nbsp; lcl_main=&amp;gt;&lt;SPAN class="me2" style="color: #202020 !important;"&gt;select_Data&lt;/SPAN&gt;&lt;SPAN class="br0" style="color: #808080 !important;"&gt;(&lt;/SPAN&gt; lo_report &lt;SPAN class="br0" style="color: #808080 !important;"&gt;)&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp; lcl_main=&amp;gt;&lt;SPAN class="me2" style="color: #202020 !important;"&gt;write_Data&lt;/SPAN&gt;&lt;SPAN class="br0" style="color: #808080 !important;"&gt;(&lt;/SPAN&gt; lo_report &lt;SPAN class="br0" style="color: #808080 !important;"&gt;)&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;i'm wondering how select_data and write_data method support input &lt;STRONG&gt;lo_report&lt;/STRONG&gt; object !&amp;nbsp; lo_report is the reference of lcl_summary class which contain interface lif_data and lif_output, as far i know the formal parameter should not support objects other than lif_data or lif_output reference.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;it seem code does not any issue,can you explain me how it is working without error?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lokesh Srinivasan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 06:10:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/importing-object-parameter-to-method/m-p/11561436#M1937357</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-03-04T06:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Importing object parameter to method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/importing-object-parameter-to-method/m-p/11561437#M1937358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Everything is fine!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When LCL_SUMMARY implements LIF_DATA and LIF_OUTPUT, every object of type LCL_SUMMARY also ownes type LIF_DATA and LIF_OUTPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your example implementation of LCL_MAIN=&amp;gt;SELECT_DATA only works with the LIF_DATA-part of lo_report. Same for LCL_SUMMARY=&amp;gt;WRITE_DATA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hubert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 09:53:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/importing-object-parameter-to-method/m-p/11561437#M1937358</guid>
      <dc:creator>hubert_heitzer</dc:creator>
      <dc:date>2016-03-04T09:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: Importing object parameter to method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/importing-object-parameter-to-method/m-p/11561438#M1937359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To add some more to this: If your parameter is TYPE REF TO some_interface, it accepts any object implementing that interface. It does not care about what or how many other interfaces the class implements.&lt;/P&gt;&lt;P&gt;Implementing several interfaces in one class is not what typically is called multiple inheritance, as the linked article suggests. There are many reasons to implement several interfaces in a class. Maybe have a look at the &lt;A href="https://en.wikipedia.org/wiki/Interface_segregation_principle"&gt;interface segregation principle&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind regards,&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 10:10:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/importing-object-parameter-to-method/m-p/11561438#M1937359</guid>
      <dc:creator>ThomasKruegl</dc:creator>
      <dc:date>2016-03-04T10:10:50Z</dc:date>
    </item>
  </channel>
</rss>

