<?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 Dynamically accessing components in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-accessing-components/m-p/7796042#M1586657</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everybody!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm a new ABAP developer and experimenting with the language a bit. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having some trouble with something I'm not actually sure is a possibility. I'd like to call components of a structure from a string variable. I know that it's possible to do so with the table it self. I have setup:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA:
        column_name type string.

        column_name = 'c1'.

        UPDATE (table_name) SET (column_name) = 'X'
          WHERE LETTER = row.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(table_name) is called via USING by the subroutine. That part is working OK. I also have a try catch block around the UPDATE which catches &lt;STRONG&gt;cx_sy_dynamic_osql_semantics&lt;/STRONG&gt; saying that (table_name) has no component named (column_name). Anybody have an idea how to properly execute this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Apr 2011 12:03:02 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-04-08T12:03:02Z</dc:date>
    <item>
      <title>Dynamically accessing components</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-accessing-components/m-p/7796042#M1586657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everybody!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm a new ABAP developer and experimenting with the language a bit. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having some trouble with something I'm not actually sure is a possibility. I'd like to call components of a structure from a string variable. I know that it's possible to do so with the table it self. I have setup:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA:
        column_name type string.

        column_name = 'c1'.

        UPDATE (table_name) SET (column_name) = 'X'
          WHERE LETTER = row.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(table_name) is called via USING by the subroutine. That part is working OK. I also have a try catch block around the UPDATE which catches &lt;STRONG&gt;cx_sy_dynamic_osql_semantics&lt;/STRONG&gt; saying that (table_name) has no component named (column_name). Anybody have an idea how to properly execute this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2011 12:03:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-accessing-components/m-p/7796042#M1586657</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-08T12:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically accessing components</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-accessing-components/m-p/7796043#M1586658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looking at the online help for the UPDATE statement, it seems you'll have to replace&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SET (column_name) = 'X'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;by&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SET (full_expression_syntax)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and prepare the syntax string accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/abapdocu_70/en/ABAPUPDATE_SET_EXPRESSION.htm#&amp;amp;ABAP_ADDITION_4@4@" target="test_blank"&gt;http://help.sap.com/abapdocu_70/en/ABAPUPDATE_SET_EXPRESSION.htm#&amp;amp;ABAP_ADDITION_4@4@&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2011 12:15:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-accessing-components/m-p/7796043#M1586658</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2011-04-08T12:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically accessing components</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-accessing-components/m-p/7796044#M1586659</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;Please try the below code from F1 help of Update&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: table    TYPE c LENGTH 30, &lt;/P&gt;&lt;P&gt;            column   TYPE c LENGTH 30, &lt;/P&gt;&lt;P&gt;            old_curr TYPE sycurr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: set_expr  TYPE string, &lt;/P&gt;&lt;P&gt;      condition TYPE string. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE column ` = 'EUR'` &lt;/P&gt;&lt;P&gt;            INTO set_expr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE column ` = old_curr` &lt;/P&gt;&lt;P&gt;            INTO condition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRY. &lt;/P&gt;&lt;P&gt;    UPDATE (table) &lt;/P&gt;&lt;P&gt;    SET    (set_expr) &lt;/P&gt;&lt;P&gt;    WHERE  (condition). &lt;/P&gt;&lt;P&gt;  CATCH cx_sy_dynamic_osql_error. &lt;/P&gt;&lt;P&gt;    MESSAGE `Error in update!` TYPE 'I'. &lt;/P&gt;&lt;P&gt;ENDTRY. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Ramya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2011 12:24:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-accessing-components/m-p/7796044#M1586659</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-08T12:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically accessing components</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-accessing-components/m-p/7796045#M1586660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you both for the prompt replies!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had at first tried to do it the way Thomas did, but I didn't realize that I had to pass the entire argument as a string and not just throw the expression in ( ).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2011 12:56:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-accessing-components/m-p/7796045#M1586660</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-08T12:56:57Z</dc:date>
    </item>
  </channel>
</rss>

