<?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 Internal table values read and assign it back in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-values-read-and-assign-it-back/m-p/3349048#M803231</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Ashok,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you have to use the ASSIGN COMPONENT field OF STRUCTURE wa TO &amp;lt;fs&amp;gt; statement!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;ec&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Jan 2008 09:20:13 GMT</pubDate>
    <dc:creator>JozsefSzikszai</dc:creator>
    <dc:date>2008-01-22T09:20:13Z</dc:date>
    <item>
      <title>Dynamic Internal table values read and assign it back</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-values-read-and-assign-it-back/m-p/3349047#M803230</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;        I want to get the internal table field name dynamically and fetch its value and do some calculation and asign the new value to the same field name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       CONCATENATE '&amp;lt;WA_PIPE&amp;gt;-ZW' v_index INTO v_fld.&lt;/P&gt;&lt;P&gt;        CONDENSE v_fld NO-GAPS.&lt;/P&gt;&lt;P&gt;        FIELD-SYMBOLS &amp;lt;fs&amp;gt; TYPE ANY.&lt;/P&gt;&lt;P&gt;        ASSIGN (v_fld) TO &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt;        v_fld1 = &amp;lt;fs&amp;gt; * &amp;lt;wa_pipe&amp;gt;-zrate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i've the internal table field name as &amp;lt;WA_PIPE&amp;gt;-ZW1 in v_fld and v_fld1 is having the value of the same field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to assign it to the internal table field.&lt;/P&gt;&lt;P&gt;&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;Ashok&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 09:13:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-values-read-and-assign-it-back/m-p/3349047#M803230</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-22T09:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Internal table values read and assign it back</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-values-read-and-assign-it-back/m-p/3349048#M803231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Ashok,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you have to use the ASSIGN COMPONENT field OF STRUCTURE wa TO &amp;lt;fs&amp;gt; statement!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;ec&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 09:20:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-values-read-and-assign-it-back/m-p/3349048#M803231</guid>
      <dc:creator>JozsefSzikszai</dc:creator>
      <dc:date>2008-01-22T09:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Internal table values read and assign it back</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-values-read-and-assign-it-back/m-p/3349049#M803232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; I've these fields and values .&lt;/P&gt;&lt;P&gt;Field name                 Field contents&lt;/P&gt;&lt;P&gt;v_fld                          &amp;lt;WA_PIPE&amp;gt;-ZW1&lt;/P&gt;&lt;P&gt;v_fld1                          32000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to assign &amp;lt;wa_pipe&amp;gt;-zw1 value as 32000.&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;Ashok...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 09:31:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-values-read-and-assign-it-back/m-p/3349049#M803232</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-22T09:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Internal table values read and assign it back</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-values-read-and-assign-it-back/m-p/3349050#M803233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  YY_TEST1&lt;/P&gt;&lt;P&gt;*&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;&lt;/P&gt;&lt;P&gt;*&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  YY_TEST1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type-pools: slis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;dyn_table&amp;gt; type standard table,&lt;/P&gt;&lt;P&gt;&amp;lt;dyn_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_alvfc type slis_t_fieldcat_alv,&lt;/P&gt;&lt;P&gt;wa_alvfc type slis_fieldcat_alv,&lt;/P&gt;&lt;P&gt;it_fldcat type lvc_t_fcat,&lt;/P&gt;&lt;P&gt;wa_fldcat type lvc_s_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen begin of block b1 with frame title text-001.&lt;/P&gt;&lt;P&gt;  parameters: p_flds(5) type c.&lt;/P&gt;&lt;P&gt;selection-screen end of block b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*build the dynamic internal table&lt;/P&gt;&lt;P&gt;perform build_dyn_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*write 5 records to the alv grid&lt;/P&gt;&lt;P&gt;do 5 times.&lt;/P&gt;&lt;P&gt;perform build_report.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*call the alv grid.&lt;/P&gt;&lt;P&gt;perform call_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Build_dyn_itab&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;form build_dyn_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Create the dynamic internal table&lt;/P&gt;&lt;P&gt;data: new_table type ref to data,&lt;/P&gt;&lt;P&gt;new_line type ref to data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Create fields .&lt;/P&gt;&lt;P&gt;do p_flds times.&lt;/P&gt;&lt;P&gt;clear wa_fldcat.&lt;/P&gt;&lt;P&gt;wa_fldcat-fieldname = sy-index.&lt;/P&gt;&lt;P&gt;wa_fldcat-datatype = 'CHAR'.&lt;/P&gt;&lt;P&gt;wa_fldcat-intlen = 5.&lt;/P&gt;&lt;P&gt;append wa_fldcat to it_fldcat .&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Create dynamic internal table and assign to FS&lt;/P&gt;&lt;P&gt;call method cl_alv_table_create=&amp;gt;create_dynamic_table&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;it_fieldcatalog = it_fldcat&lt;/P&gt;&lt;P&gt;importing&lt;/P&gt;&lt;P&gt;ep_table = new_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;assign new_table-&amp;gt;* to &amp;lt;dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Create dynamic work area and assign to FS&lt;/P&gt;&lt;P&gt;create data new_line like line of &amp;lt;dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;assign new_line-&amp;gt;* to &amp;lt;dyn_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*********************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Form build_report&lt;/P&gt;&lt;P&gt;*********************************************************************&lt;/P&gt;&lt;P&gt;form build_report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Fill some values into the dynamic internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: fieldname(20) type c.&lt;/P&gt;&lt;P&gt;data: fieldvalue(5) type c.&lt;/P&gt;&lt;P&gt;data: index(3) type c.&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;fs1&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do p_flds times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;index = sy-index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Set up fieldvalue&lt;/P&gt;&lt;P&gt;concatenate 'FLD' index into&lt;/P&gt;&lt;P&gt;fieldvalue.&lt;/P&gt;&lt;P&gt;condense fieldvalue no-gaps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;assign component index of structure &amp;lt;dyn_wa&amp;gt; to &amp;lt;fs1&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;lt;fs1&amp;gt; = fieldvalue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Append to the dynamic internal table&lt;/P&gt;&lt;P&gt;append &amp;lt;dyn_wa&amp;gt; to &amp;lt;dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*CALL_ALV&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;form call_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Build FC for ALV&lt;/P&gt;&lt;P&gt;loop at it_fldcat into wa_fldcat.&lt;/P&gt;&lt;P&gt;wa_alvfc-fieldname = wa_fldcat-fieldname.&lt;/P&gt;&lt;P&gt;wa_alvfc-seltext_s = sy-tabix.&lt;/P&gt;&lt;P&gt;wa_alvfc-outputlen = wa_fldcat-intlen.&lt;/P&gt;&lt;P&gt;append wa_alvfc to it_alvfc.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Call ABAP List Viewer (ALV)&lt;/P&gt;&lt;P&gt;call function 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;it_fieldcat = it_alvfc&lt;/P&gt;&lt;P&gt;tables&lt;/P&gt;&lt;P&gt;t_outtab = &amp;lt;dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 09:43:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-values-read-and-assign-it-back/m-p/3349050#M803233</guid>
      <dc:creator>Madhurivs23</dc:creator>
      <dc:date>2008-01-22T09:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Internal table values read and assign it back</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-values-read-and-assign-it-back/m-p/3349051#M803234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ashok&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is a sample coding which shows how to work with dynamic itabs and field symbols:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

LOOP AT &amp;lt;lt_itab&amp;gt;  ASSIGNING &amp;lt;ls_record&amp;gt;.
  CONCATENATE '&amp;lt;WA_PIPE&amp;gt;-ZW' v_index INTO v_fld.
  CONDENSE v_fld NO-GAPS.

  ASSIGN COMPONENT v_fld      OF STRUCTURE &amp;lt;ls_record&amp;gt; to &amp;lt;ld_fld&amp;gt;.
  ASSIGN COMPONENT 'ZRATE' OF STRUCTURE &amp;lt;ls_record&amp;gt; to &amp;lt;ld_zrate&amp;gt;.

  &amp;lt;ld_fld&amp;gt; = &amp;lt;ld_fld&amp;gt; * &amp;lt;ld_zrate&amp;gt;.
  " NOTE: Since we are working with field symbols there is no need to make
  "            a modify of the itab since it is immediately updated
ENDLOOP.

&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>Fri, 25 Jan 2008 00:36:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-values-read-and-assign-it-back/m-p/3349051#M803234</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-01-25T00:36:07Z</dc:date>
    </item>
  </channel>
</rss>

