<?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 Use AGENT through dynamic attribute access in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/use-agent-through-dynamic-attribute-access/m-p/4826042#M1129312</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working with some persistent objects, but don't know the actual persistent class until runttime.  To get the agent, I've coded this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: l_agntclass TYPE classname,
     lr_det_agent TYPE REF TO cl_os_ca_common.

FIELD-SYMBOLS &amp;lt;lr_det_agent&amp;gt; TYPE any.

l_agntclass = me-&amp;gt;derive_agent_classname( ).

ASSIGN (l_agntclass)=&amp;gt;agent to &amp;lt;lr_det_agent&amp;gt;.
lr_det_agent ?= &amp;lt;lr_det_agent&amp;gt;.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I can call the methods of lr_det_agent.  All well and good, and it works, but is this the right way?  I tried defining &amp;lt;lr_det_agent&amp;gt; as TYPE REF TO.  But that failed in the assign.  And I tried CASTING TYPE on the assign, but that doesn't accept classes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I missing something obvious? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Nov 2008 06:10:00 GMT</pubDate>
    <dc:creator>matt</dc:creator>
    <dc:date>2008-11-26T06:10:00Z</dc:date>
    <item>
      <title>Use AGENT through dynamic attribute access</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/use-agent-through-dynamic-attribute-access/m-p/4826042#M1129312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working with some persistent objects, but don't know the actual persistent class until runttime.  To get the agent, I've coded this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: l_agntclass TYPE classname,
     lr_det_agent TYPE REF TO cl_os_ca_common.

FIELD-SYMBOLS &amp;lt;lr_det_agent&amp;gt; TYPE any.

l_agntclass = me-&amp;gt;derive_agent_classname( ).

ASSIGN (l_agntclass)=&amp;gt;agent to &amp;lt;lr_det_agent&amp;gt;.
lr_det_agent ?= &amp;lt;lr_det_agent&amp;gt;.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I can call the methods of lr_det_agent.  All well and good, and it works, but is this the right way?  I tried defining &amp;lt;lr_det_agent&amp;gt; as TYPE REF TO.  But that failed in the assign.  And I tried CASTING TYPE on the assign, but that doesn't accept classes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I missing something obvious? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2008 06:10:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/use-agent-through-dynamic-attribute-access/m-p/4826042#M1129312</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2008-11-26T06:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: Use AGENT through dynamic attribute access</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/use-agent-through-dynamic-attribute-access/m-p/4826043#M1129313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Matt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution is quite simple (see below):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZUS_SDN_PERSISTENT_CLASS
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Thread: Use AGENT through dynamic attribute access
*&amp;amp; &amp;lt;a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1143122"&amp;gt;&amp;lt;/a&amp;gt;
*&amp;amp;---------------------------------------------------------------------*

REPORT  zus_sdn_persistent_class.


DATA: gd_clsname    TYPE classname,
      gd_method     TYPE string,
      gd_attribute  TYPE string.

DATA: go_obj        TYPE REF TO object,  " root object
      go_os_common  TYPE REF TO cl_os_ca_common.

DATA: go_persist    TYPE REF TO cb_alert,
      go_agent      TYPE REF TO ca_alert.

FIELD-SYMBOLS &amp;lt;go_det_agent&amp;gt; TYPE ANY.

START-OF-SELECTION.

  BREAK-POINT.

  gd_attribute = 'CA_ALERT=&amp;gt;AGENT'.
  " In your case: CONCATENATE l_agntclass '=&amp;gt;AGENT' ...
  ASSIGN (gd_attribute) TO &amp;lt;go_det_agent&amp;gt;.

  go_os_common ?= &amp;lt;go_det_agent&amp;gt;.

  BREAK-POINT.

END-OF-SELECTION.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&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>Wed, 26 Nov 2008 09:18:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/use-agent-through-dynamic-attribute-access/m-p/4826043#M1129313</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-11-26T09:18:38Z</dc:date>
    </item>
  </channel>
</rss>

