<?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: Storing values in internal table into workarea dynamically in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/storing-values-in-internal-table-into-workarea-dynamically/m-p/974600#M70557</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, you can reference the code as following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
types:begin of typ_test,
        field1  type  char10,
        field2  type  char10,
        field3  type  char10,
      end of typ_test.
data: it_test     type standard table of typ_test,
      lc_test     like line of it_test,
      lc_test2    like line of it_test,
      lc_fldname  type  char10,
      lc_fldname2 type  char10,
      dref        TYPE REF TO DATA.
field-symbols: &amp;lt;fs&amp;gt;, &amp;lt;fs2&amp;gt;.

lc_test-field1 = 1.
lc_test-field2 = 2.
lc_test-field3 = 3.
append lc_test to it_test.

loop at it_test into lc_test.
  get reference of lc_test2 into dref.
  ASSIGN dref-&amp;gt;* TO &amp;lt;fs&amp;gt;.
  assign component 'FIELD1' of structure &amp;lt;fs&amp;gt; to &amp;lt;fs2&amp;gt;.
  &amp;lt;fs2&amp;gt; = lc_test-field1.
* you can find lc_test2-field1 has a value already
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it will be valuable.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Aug 2005 15:05:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-08-24T15:05:36Z</dc:date>
    <item>
      <title>Storing values in internal table into workarea dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/storing-values-in-internal-table-into-workarea-dynamically/m-p/974598#M70555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following piece of code is used to assign the value of a field in an internal table to a field in a workarea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lwa_subscr - workarea&lt;/P&gt;&lt;P&gt;li_subscrbe - Internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. loop at li_subscrbe.&lt;/P&gt;&lt;P&gt;2.  lwa_subscr-mailerid = li_subscrbe-mailerid.&lt;/P&gt;&lt;P&gt;3.  lwa_subscr-cust_no = li_subscrbe-cust_no.&lt;/P&gt;&lt;P&gt;*this assigns the field name dynamically to a string variable 'event_field'&lt;/P&gt;&lt;P&gt;4.  concatenate 'lwa_subscr-' li_subscrbe-eventid into event_field.&lt;/P&gt;&lt;P&gt;5.   assign table field event_field to &amp;lt;fs_event&amp;gt;.&lt;/P&gt;&lt;P&gt;6.    move li_subscrbe-subscr_value to &amp;lt;fs_event&amp;gt;.&lt;/P&gt;&lt;P&gt;7.  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want to assign the value of a field 'subscr_value' in internal table 'li_subscrbe', into a field of workarea.&lt;/P&gt;&lt;P&gt;The 'move' statement assigns the value to field symbol and not to the field stored in the field symbol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;Before line 5, the value of field symbol &amp;lt;fs_event&amp;gt; has value 'lwa_subscr-volume' where 'volume' is one of the columns of the work area. &lt;/P&gt;&lt;P&gt;But in line 6, i want the integer value in 'li_subscrbe-subscr_value' to be assigned to 'lwa_subscr-volume', but the interger value gets assisgned to the field symbol itself. &lt;/P&gt;&lt;P&gt;how else can i implement this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Aug 2005 14:21:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/storing-values-in-internal-table-into-workarea-dynamically/m-p/974598#M70555</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-24T14:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Storing values in internal table into workarea dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/storing-values-in-internal-table-into-workarea-dynamically/m-p/974599#M70556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your ASSIGN statement, make sure that you have parenthesis around the field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report  zrich_0002.


data: begin of itab occurs 0,
      field1 type i,
      end of itab.

data: wa like line of itab.
data: wa_field(20) type c.


field-symbols: &amp;lt;fs1&amp;gt;,
               &amp;lt;fs2&amp;gt;.


itab-field1 = '1234'.
append itab.



read table itab index 1.

concatenate 'WA' 'FIELD1' into WA_field separated by '-'.

&amp;lt;b&amp;gt;assign (wa_field) to &amp;lt;fs1&amp;gt;.&amp;lt;/b&amp;gt;

move itab-field1 to &amp;lt;fs1&amp;gt;.

write:/ &amp;lt;fs1&amp;gt;.

&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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Aug 2005 14:54:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/storing-values-in-internal-table-into-workarea-dynamically/m-p/974599#M70556</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-08-24T14:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: Storing values in internal table into workarea dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/storing-values-in-internal-table-into-workarea-dynamically/m-p/974600#M70557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, you can reference the code as following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
types:begin of typ_test,
        field1  type  char10,
        field2  type  char10,
        field3  type  char10,
      end of typ_test.
data: it_test     type standard table of typ_test,
      lc_test     like line of it_test,
      lc_test2    like line of it_test,
      lc_fldname  type  char10,
      lc_fldname2 type  char10,
      dref        TYPE REF TO DATA.
field-symbols: &amp;lt;fs&amp;gt;, &amp;lt;fs2&amp;gt;.

lc_test-field1 = 1.
lc_test-field2 = 2.
lc_test-field3 = 3.
append lc_test to it_test.

loop at it_test into lc_test.
  get reference of lc_test2 into dref.
  ASSIGN dref-&amp;gt;* TO &amp;lt;fs&amp;gt;.
  assign component 'FIELD1' of structure &amp;lt;fs&amp;gt; to &amp;lt;fs2&amp;gt;.
  &amp;lt;fs2&amp;gt; = lc_test-field1.
* you can find lc_test2-field1 has a value already
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it will be valuable.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Aug 2005 15:05:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/storing-values-in-internal-table-into-workarea-dynamically/m-p/974600#M70557</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-24T15:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Storing values in internal table into workarea dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/storing-values-in-internal-table-into-workarea-dynamically/m-p/974601#M70558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You for that help. It solved the problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2005 03:40:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/storing-values-in-internal-table-into-workarea-dynamically/m-p/974601#M70558</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-25T03:40:55Z</dc:date>
    </item>
  </channel>
</rss>

