<?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: Calling a Method of Interface by using Object in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method-of-interface-by-using-object/m-p/5343684#M1230700</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; If you have the instance of the class then you need to use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD instance-&amp;gt;if_interface~method_name (&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;IMPORTING ).&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;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Mar 2009 10:12:01 GMT</pubDate>
    <dc:creator>seshatalpasai_madala</dc:creator>
    <dc:date>2009-03-17T10:12:01Z</dc:date>
    <item>
      <title>Calling a Method of Interface by using Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method-of-interface-by-using-object/m-p/5343683#M1230699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to use a method of a class which will be IF_ABC_XYZ~ &amp;lt;amethod&amp;gt; ( ). how can i use this method in my program , I have the instance of the class which have the above mentioned method?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2009 09:58:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method-of-interface-by-using-object/m-p/5343683#M1230699</guid>
      <dc:creator>bpawanchand</dc:creator>
      <dc:date>2009-03-17T09:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a Method of Interface by using Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method-of-interface-by-using-object/m-p/5343684#M1230700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; If you have the instance of the class then you need to use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD instance-&amp;gt;if_interface~method_name (&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;IMPORTING ).&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;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2009 10:12:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method-of-interface-by-using-object/m-p/5343684#M1230700</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2009-03-17T10:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a Method of Interface by using Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method-of-interface-by-using-object/m-p/5343685#M1230701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here the case is like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data :&lt;/P&gt;&lt;P&gt;       lv_type  TYPE REF TO  IF_some xyz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now by using a static class method i am able to get the return type equal to lv_type i.e&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD cl_someclassname=&amp;gt; amethod ( )&lt;/P&gt;&lt;P&gt;   IMPORTING&lt;/P&gt;&lt;P&gt;       type      =  lv_type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now when i debug and see lv_type is having a class name inside it. I want to use a method of this class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I call the method which Iam able to see in the lv_type when i debug.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2009 10:18:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method-of-interface-by-using-object/m-p/5343685#M1230701</guid>
      <dc:creator>bpawanchand</dc:creator>
      <dc:date>2009-03-17T10:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a Method of Interface by using Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method-of-interface-by-using-object/m-p/5343686#M1230702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to cast your interface object to the corresponding class object:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data :
lv_type TYPE REF TO IF_some xyz,
lo_class TYPE REF TO cl_xyz_class.  " implements interface IF_SOME_XYZ

now by using a static class method i am able to get the return type equal to lv_type i.e

CALL METHOD cl_someclassname=&amp;gt; amethod ( )
IMPORTING
type = lv_type.

lo_class ?= lv_type.
CALL METHOD lo_class-&amp;gt;name_of_method.&lt;/CODE&gt;&lt;/PRE&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>Tue, 17 Mar 2009 10:50:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method-of-interface-by-using-object/m-p/5343686#M1230702</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2009-03-17T10:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a Method of Interface by using Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method-of-interface-by-using-object/m-p/5343687#M1230703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks I already resolved the issue, as you said in the exmaple, I also approched the same way , Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2009 11:36:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method-of-interface-by-using-object/m-p/5343687#M1230703</guid>
      <dc:creator>bpawanchand</dc:creator>
      <dc:date>2009-03-17T11:36:13Z</dc:date>
    </item>
  </channel>
</rss>

