<?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: Data allocation for internal table rows Dynamically in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-allocation-for-internal-table-rows-dynamically/m-p/3592766#M865086</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aditya&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply, but I am having 400 columns, not rows.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Mar 2008 07:29:59 GMT</pubDate>
    <dc:creator>praveen_hannu</dc:creator>
    <dc:date>2008-03-25T07:29:59Z</dc:date>
    <item>
      <title>Data allocation for internal table rows Dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-allocation-for-internal-table-rows-dynamically/m-p/3592764#M865084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have requirement like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one internal table with 400 amounts columns, I will get the value from another program&lt;/P&gt;&lt;P&gt; that indicates to which column I have to add the values. I dont want to write the case statement&lt;/P&gt;&lt;P&gt;because I need to write 400 WHEN statements. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any alternative way dynamically I can choose the internal table column and assign the value which&lt;/P&gt;&lt;P&gt;I am getting from external program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help on this as soon as possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Points will be rewarded&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;Praveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 07:18:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-allocation-for-internal-table-rows-dynamically/m-p/3592764#M865084</guid>
      <dc:creator>praveen_hannu</dc:creator>
      <dc:date>2008-03-25T07:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: Data allocation for internal table rows Dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-allocation-for-internal-table-rows-dynamically/m-p/3592765#M865085</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 can do one thing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab index &amp;lt;value which you get from another program&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now add the value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modift itab index sy-tabix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(I believe you have 400 rows)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Aditya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 07:24:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-allocation-for-internal-table-rows-dynamically/m-p/3592765#M865085</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T07:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: Data allocation for internal table rows Dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-allocation-for-internal-table-rows-dynamically/m-p/3592766#M865086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aditya&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply, but I am having 400 columns, not rows.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 07:29:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-allocation-for-internal-table-rows-dynamically/m-p/3592766#M865086</guid>
      <dc:creator>praveen_hannu</dc:creator>
      <dc:date>2008-03-25T07:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Data allocation for internal table rows Dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-allocation-for-internal-table-rows-dynamically/m-p/3592767#M865087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Praveen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you may use the ASSIGN COMPONENT ... OF STRUCTURE ... statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It allows to assign the field by name or by sequence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assume you columns have names like amount_001 to amount_999 and are fields of structure ls_amounts. The do as decribed here roughly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data:
  lv_fieldseq type NUMC_3,
  lv_fieldname type fieldname,
  lv_amount type (???).
fieldsymbols:
  &amp;lt;amount&amp;gt; type any.
* fetch amount and field sequence from external data into  lv_amount and lv_fieldseq 
concatenate 'AMOUNT_' lv_fieldseq into lv_fieldname.
* &amp;lt;amount&amp;gt; is something like a pointer
assign component (lv_fieldname) of structure ls_amounts to &amp;lt;amount&amp;gt;.
add lv_amount  to &amp;lt;amount&amp;gt;.  
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you are sure you have the correct position of the amount field in the structure stored in variable lv_position, you may use &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
assign component lv_position of structure ls_amounts to &amp;lt;amount&amp;gt;.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I prefer the ASSIGN (fieldname) for reasons of more transparency and less danger in case of structural changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 07:39:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-allocation-for-internal-table-rows-dynamically/m-p/3592767#M865087</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2008-03-25T07:39:43Z</dc:date>
    </item>
  </channel>
</rss>

