<?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: Dynamic interface declaration in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-interface-declaration/m-p/6309711#M1392437</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As long as lv_object_name contains the name of an interface that exists, then the syntax is valid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Nov 2009 14:23:24 GMT</pubDate>
    <dc:creator>matt</dc:creator>
    <dc:date>2009-11-16T14:23:24Z</dc:date>
    <item>
      <title>Dynamic interface declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-interface-declaration/m-p/6309710#M1392436</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;Is it possible to have a dynamic interface declaration like you can have a dynamic object declaration?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For an object:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: lo_object type ref to object.&lt;/P&gt;&lt;P&gt;create object lo_object type (lv_object_name).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this in some way possible to do with an interface? I need to do this for an interface at runtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gr,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jaron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Nov 2009 13:45:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-interface-declaration/m-p/6309710#M1392436</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-16T13:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic interface declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-interface-declaration/m-p/6309711#M1392437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As long as lv_object_name contains the name of an interface that exists, then the syntax is valid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Nov 2009 14:23:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-interface-declaration/m-p/6309711#M1392437</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2009-11-16T14:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic interface declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-interface-declaration/m-p/6309712#M1392438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I get an error message saying I can't do it because it's not a class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: J. Frenk on Nov 16, 2009 3:26 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Nov 2009 14:26:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-interface-declaration/m-p/6309712#M1392438</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-16T14:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic interface declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-interface-declaration/m-p/6309713#M1392439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;oops.  my bad.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, of course you'll get that error.  Because you can't create an object reference to an interface.  It has to be reference to a concrete class.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you wanting something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: r_ref TYPE REF TO (my_interface).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where my_interface contains the name of the interface?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Nov 2009 15:10:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-interface-declaration/m-p/6309713#M1392439</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2009-11-16T15:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic interface declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-interface-declaration/m-p/6309714#M1392440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can create data of a dynamically given reference  type (which may be an interface) and move the object reference to it.&lt;/P&gt;&lt;P&gt;Something like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA:
      my_obj TYPE REF TO object,
      lr_data TYPE REF TO data.

  FIELD-SYMBOLS: &amp;lt;fs&amp;gt; TYPE ANY.

  CREATE OBJECT my_obj TYPE my_object_type.

TRY.
  CREATE DATA lr_data TYPE REF TO (some_interface_type_name).
  ASSIGN lr_data-&amp;gt;* TO &amp;lt;fs&amp;gt;.
   &amp;lt;fs&amp;gt; ?= my_obj.

  CATCH cx_sy_move_cast_error.
  CATCH cx_sy_create_data_error.
ENDTRY.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, the assignment tests if my_obj is an instance of the type named some_interface_type_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Sebastian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Nov 2009 08:28:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-interface-declaration/m-p/6309714#M1392440</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-18T08:28:13Z</dc:date>
    </item>
  </channel>
</rss>

