<?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: calculation on dynamic Internal table fields in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-on-dynamic-internal-table-fields/m-p/5636345#M1282909</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;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 ) 1st calculate the number of records in that internal table&lt;/P&gt;&lt;P&gt;2)  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Do i_values_count times.

clear var1.
Var1 = quantity * &amp;lt;fs&amp;gt;-field1.

append var1 to i_itab2.

enddo.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i_values_count is your total count in internal table&lt;/P&gt;&lt;P&gt;var1 for which your calculated value will be moved&lt;/P&gt;&lt;P&gt;i_itab2 which collects all the calculated sum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sudhe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 May 2009 11:37:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-19T11:37:55Z</dc:date>
    <item>
      <title>calculation on dynamic Internal table fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-on-dynamic-internal-table-fields/m-p/5636344#M1282908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one dynamic internal table in this i have to do some calcultaions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dynamic inertnal table fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;quanity&lt;/P&gt;&lt;P&gt;c010&lt;/P&gt;&lt;P&gt;c020&lt;/P&gt;&lt;P&gt;c030&lt;/P&gt;&lt;P&gt;c040&lt;/P&gt;&lt;P&gt;c050&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;**********&lt;/P&gt;&lt;P&gt;i want to caluclate like for all the records in the internla table&lt;/P&gt;&lt;P&gt;quantity * c010&lt;/P&gt;&lt;P&gt;quantity * c020&lt;/P&gt;&lt;P&gt;quantity * c030&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;is it possible, how can it be done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Farooq&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 11:25:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-on-dynamic-internal-table-fields/m-p/5636344#M1282908</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-19T11:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: calculation on dynamic Internal table fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-on-dynamic-internal-table-fields/m-p/5636345#M1282909</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;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 ) 1st calculate the number of records in that internal table&lt;/P&gt;&lt;P&gt;2)  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Do i_values_count times.

clear var1.
Var1 = quantity * &amp;lt;fs&amp;gt;-field1.

append var1 to i_itab2.

enddo.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i_values_count is your total count in internal table&lt;/P&gt;&lt;P&gt;var1 for which your calculated value will be moved&lt;/P&gt;&lt;P&gt;i_itab2 which collects all the calculated sum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sudhe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 11:37:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-on-dynamic-internal-table-fields/m-p/5636345#M1282909</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-19T11:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: calculation on dynamic Internal table fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-on-dynamic-internal-table-fields/m-p/5636346#M1282910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do it with field symbols&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab assigning &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt; &amp;lt;fs1&amp;gt; = &amp;lt;fs&amp;gt;-quantity * &amp;lt;fs&amp;gt;-c010.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 11:40:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-on-dynamic-internal-table-fields/m-p/5636346#M1282910</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-19T11:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: calculation on dynamic Internal table fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-on-dynamic-internal-table-fields/m-p/5636347#M1282911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi..&lt;/P&gt;&lt;P&gt;Try building the logic with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASSIGN COMPONENT sy-index OF STRUCTURE &amp;lt;&amp;gt; TO &amp;lt;&amp;gt;.    or a similar variant &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 11:42:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-on-dynamic-internal-table-fields/m-p/5636347#M1282911</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-19T11:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: calculation on dynamic Internal table fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-on-dynamic-internal-table-fields/m-p/5636348#M1282912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is more or less not working code, but shows how to achieve that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop at itab assigning &amp;lt;p&amp;gt;.
  do 5 times.
    cinx = sy-index.
    shift cinx left by 1 places.
    overlay cinx with '000'.
    concatenate '&amp;lt;p&amp;gt;-c' cinx into varname.
    assign &amp;lt;fs&amp;gt; to varname.
    &amp;lt;fs&amp;gt; = &amp;lt;fs&amp;gt; * qty.
  enddo.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cinx should be a c var in length 3, &amp;lt;p&amp;gt; a fieldsymbol with linetype of your table, and &amp;lt;fs&amp;gt; a field symbol type to your columns. This will upodate c010, c020, c030, c040 and c050. You have to modify the do statements to fit your needs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 11:45:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-on-dynamic-internal-table-fields/m-p/5636348#M1282912</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2009-05-19T11:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: calculation on dynamic Internal table fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-on-dynamic-internal-table-fields/m-p/5636349#M1282913</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;Thanks for responce.&lt;/P&gt;&lt;P&gt;but here the problem is field names are dynamic. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fields names are not fixed. it may change &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;Quantiy&lt;/P&gt;&lt;P&gt;c010&lt;/P&gt;&lt;P&gt;c050&lt;/P&gt;&lt;P&gt;c070&lt;/P&gt;&lt;P&gt;c100&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="5" type="ul"&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 11:49:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculation-on-dynamic-internal-table-fields/m-p/5636349#M1282913</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-19T11:49:10Z</dc:date>
    </item>
  </channel>
</rss>

