<?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 Manipulation in internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-manipulation-in-internal-table/m-p/2805837#M655660</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;1. In the loop at i_vbrp. you sum up total of all &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;I assume you habe value 1 and value 2 as follow in the final table.&lt;/P&gt;&lt;P&gt;value 1 in some global variable. like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;loop at i_vbrp.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; read table i_konv...&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt; i_finaltable-netwr = konv-kwert.  value 1  1000 (A)&lt;/P&gt;&lt;P&gt;                                           2000 (B)   for each line item&lt;/P&gt;&lt;P&gt;                                           3000 (C)  when looping&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt; wg_sum = wg_sum +      i_finaltable-netwr&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt; read table i_bseg....&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;i_finaltable-wskto = i_bseg-wskto. value 2 ,300 fixed for a unique VBELN&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;endloop.&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Now in &lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;loop at i_finalitab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i_finalitab-valu3 = ( i_finalitab-value1 / wg_sum ) * i_finalitab-value2.&lt;/P&gt;&lt;P&gt;modify i_finalitab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&amp;lt;/i&amp;gt;          &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this will give you dsired result. Let me know if you have any issue in this.&lt;/P&gt;&lt;P&gt;Enjoy SAP.&lt;/P&gt;&lt;P&gt;Pankaj Singh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Sep 2007 19:21:59 GMT</pubDate>
    <dc:creator>messier31</dc:creator>
    <dc:date>2007-09-10T19:21:59Z</dc:date>
    <item>
      <title>Data Manipulation in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-manipulation-in-internal-table/m-p/2805836#M655659</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 am looping at an item internal table i_vbrp. inside the loop i am getting 2 individual values, which i am appending to a final table i_finaltable. but in between i have to distribute the 2nd value to all line items based on 1st value in percentages and should be assigned to a 3rd value. and these split values should be appended to each line item. the code and example values look like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at i_vbrp.
 
 read table i_konv...
    
 i_finaltable-netwr = konv-kwert.  value 1  1000 (A)
                                           2000 (B)   for each line item
                                           3000 (C)  when looping
 read table i_bseg....
 
i_finaltable-wskto = i_bseg-wskto. value 2 ,300 fixed for a unique VBELN
 
endloop.&lt;/CODE&gt;&lt;/PRE&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;The value 300 should be distributed to each line item based on percentages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;value 1         value 2           value 3
1000             300             (1000/(1000+2000+3000)) * 300 
2000             300             (2000/(1000+2000+3000)) * 300
3000             300             (3000/(1000+2000+3000)) * 300&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i should get the values like above in the final table, any suggestions will be awarded. Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Poorna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2007 18:53:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-manipulation-in-internal-table/m-p/2805836#M655659</guid>
      <dc:creator>former_member810660</dc:creator>
      <dc:date>2007-09-10T18:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Data Manipulation in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-manipulation-in-internal-table/m-p/2805837#M655660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;1. In the loop at i_vbrp. you sum up total of all &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;I assume you habe value 1 and value 2 as follow in the final table.&lt;/P&gt;&lt;P&gt;value 1 in some global variable. like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;loop at i_vbrp.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; read table i_konv...&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt; i_finaltable-netwr = konv-kwert.  value 1  1000 (A)&lt;/P&gt;&lt;P&gt;                                           2000 (B)   for each line item&lt;/P&gt;&lt;P&gt;                                           3000 (C)  when looping&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt; wg_sum = wg_sum +      i_finaltable-netwr&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt; read table i_bseg....&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;i_finaltable-wskto = i_bseg-wskto. value 2 ,300 fixed for a unique VBELN&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;endloop.&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Now in &lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;loop at i_finalitab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i_finalitab-valu3 = ( i_finalitab-value1 / wg_sum ) * i_finalitab-value2.&lt;/P&gt;&lt;P&gt;modify i_finalitab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&amp;lt;/i&amp;gt;          &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this will give you dsired result. Let me know if you have any issue in this.&lt;/P&gt;&lt;P&gt;Enjoy SAP.&lt;/P&gt;&lt;P&gt;Pankaj Singh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2007 19:21:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-manipulation-in-internal-table/m-p/2805837#M655660</guid>
      <dc:creator>messier31</dc:creator>
      <dc:date>2007-09-10T19:21:59Z</dc:date>
    </item>
  </channel>
</rss>

