<?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 access to attributes in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-access-to-attributes/m-p/7002205#M1495386</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi dsp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think that this will do the trick. If I just call a get method and provide the name of the attribute as import parameter, I get method must now determine the attribute dynamically. I want to avoid in any case any SWITCH or IF cases, I want to access attribute values dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Mathias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Jun 2010 08:08:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-06-02T08:08:07Z</dc:date>
    <item>
      <title>Dynamic access to attributes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-access-to-attributes/m-p/7002203#M1495384</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 have a class with many public static attributes. To provide a generic solution I want to access the value of such an attribute dynamically at run-time. Unfortunately am I not able to do it. Can you help me with this issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following code fragment for instance is not allowed. In this case I receive the syntax error that 'Dynamic attribute declarations are not supported in the current statement'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: 
lv_txt         TYPE string,
lv_attribute   TYPE string.

lv_attribute = 'TEST'.
lv_txt = Z_TEST=&amp;gt;(lv_attribute).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any hint is welcome...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, Mathias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jun 2010 07:22:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-access-to-attributes/m-p/7002203#M1495384</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-02T07:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic access to attributes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-access-to-attributes/m-p/7002204#M1495385</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;you could do a little workaround by calling a get-method dynamicly, which will return the attribute you would like to read:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD Z_TEST=&amp;gt;(ld_methodname)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;greetings,&lt;/P&gt;&lt;P&gt;dsp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jun 2010 07:48:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-access-to-attributes/m-p/7002204#M1495385</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-02T07:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic access to attributes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-access-to-attributes/m-p/7002205#M1495386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi dsp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think that this will do the trick. If I just call a get method and provide the name of the attribute as import parameter, I get method must now determine the attribute dynamically. I want to avoid in any case any SWITCH or IF cases, I want to access attribute values dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Mathias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jun 2010 08:08:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-access-to-attributes/m-p/7002205#M1495386</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-02T08:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic access to attributes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-access-to-attributes/m-p/7002206#M1495387</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;you could concatenate the methodname, but you would still need to implement a real method which will returnjust the specific attribute:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate 'get_' ld_attribute into ld_methodname&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jun 2010 08:12:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-access-to-attributes/m-p/7002206#M1495387</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-02T08:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic access to attributes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-access-to-attributes/m-p/7002207#M1495388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to access it using dynamic assing&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FIELD-SYMBOLS &amp;lt;attr&amp;gt; TYPE string.

ASSIGN cl_abap_char_utilities=&amp;gt;('HORIZONTAL_TAB') TO &amp;lt;attr&amp;gt;.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For reference [Accessing Class Components |http://help.sap.com/abapdocu_70/en/ABENCLASS_COMPONENTS_ADDRESSING.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Marcin Pciak on Jun 2, 2010 10:16 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jun 2010 08:16:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-access-to-attributes/m-p/7002207#M1495388</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-06-02T08:16:00Z</dc:date>
    </item>
  </channel>
</rss>

