<?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: ask abap logic in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/ask-abap-logic/m-p/1819362#M350363</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;&lt;/P&gt;&lt;P&gt;yes make a new table ptab:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pco sum &lt;/P&gt;&lt;P&gt;A    143&lt;/P&gt;&lt;P&gt;B    115&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so you can calculate when you loop your itab.&lt;/P&gt;&lt;P&gt;readt table ptab with key pco = itab-pco.&lt;/P&gt;&lt;P&gt;itab-percent = itab-amt / ptab-sum * 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andreas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Andreas Mann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Jan 2007 13:37:41 GMT</pubDate>
    <dc:creator>andreas_mann3</dc:creator>
    <dc:date>2007-01-15T13:37:41Z</dc:date>
    <item>
      <title>ask abap logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ask-abap-logic/m-p/1819360#M350361</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 need to get the percentage of the amount allocated from 1 company to other company.&lt;/P&gt;&lt;P&gt;i put the data in internal table&lt;/P&gt;&lt;P&gt;pco      rco     amt     percentage&lt;/P&gt;&lt;P&gt;A         X        20k&lt;/P&gt;&lt;P&gt;A         X        15k&lt;/P&gt;&lt;P&gt;A         X         5k&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need to do collect so that same record can summate up &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[internal table 2]&lt;/P&gt;&lt;P&gt;pco   rco   amt   pct &lt;/P&gt;&lt;P&gt;A      X      40k   27.97%&lt;/P&gt;&lt;P&gt;A      Y      75k&lt;/P&gt;&lt;P&gt;A      Z       28k&lt;/P&gt;&lt;P&gt;B      S      68k&lt;/P&gt;&lt;P&gt;B      F      47k&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example above, co A has allocated its charges to co X,Y and Z where the total charges are 40k, 75k and 28k respectively. for co X, the percentage is (40/143)*100%. the same formula applies to other company.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May i know what method should be efficient to get the percentage that charge to each rco? Should i create another internal table called [total amount] with pco and total amt. when loop the [internal table 2] above i can read table of the [total amount] to get the total amount for each pco.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;need advice.&lt;/P&gt;&lt;P&gt;thanks alot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jan 2007 13:27:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ask-abap-logic/m-p/1819360#M350361</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-15T13:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: ask abap logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ask-abap-logic/m-p/1819361#M350362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;now ur internal table has&lt;/P&gt;&lt;P&gt;A  X 20&lt;/P&gt;&lt;P&gt;A  X 40&lt;/P&gt;&lt;P&gt;A  X 5&lt;/P&gt;&lt;P&gt;A  Y 40&lt;/P&gt;&lt;P&gt;A  Z 40&lt;/P&gt;&lt;P&gt;A  Z 30&lt;/P&gt;&lt;P&gt;B  P 40&lt;/P&gt;&lt;P&gt;B  Z 70&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;  collect itab.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So itab will have&lt;/P&gt;&lt;P&gt;A  X 65&lt;/P&gt;&lt;P&gt;A  Y 40&lt;/P&gt;&lt;P&gt;A  Z 70&lt;/P&gt;&lt;P&gt;B  P 40&lt;/P&gt;&lt;P&gt;B  Z 40&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, take one more internal table itab2 which has&lt;/P&gt;&lt;P&gt;A  65&lt;/P&gt;&lt;P&gt;A  40&lt;/P&gt;&lt;P&gt;A  70&lt;/P&gt;&lt;P&gt;B  40&lt;/P&gt;&lt;P&gt;B  40&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;  collect itab1.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab1 will have&lt;/P&gt;&lt;P&gt;A  175&lt;/P&gt;&lt;P&gt;B  80&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;  v_tabix = sy-tabix.&lt;/P&gt;&lt;P&gt;  read table itab1 with key &amp;lt;field1&amp;gt; = itab-&amp;lt;field1&amp;gt;.&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    itab-field4 = (itab-field3/itab1-field2)* 100.&lt;/P&gt;&lt;P&gt;    modify itab index v_tabix.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Ramesh Babu Chirumamilla&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jan 2007 13:35:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ask-abap-logic/m-p/1819361#M350362</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-15T13:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: ask abap logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ask-abap-logic/m-p/1819362#M350363</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;&lt;/P&gt;&lt;P&gt;yes make a new table ptab:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pco sum &lt;/P&gt;&lt;P&gt;A    143&lt;/P&gt;&lt;P&gt;B    115&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so you can calculate when you loop your itab.&lt;/P&gt;&lt;P&gt;readt table ptab with key pco = itab-pco.&lt;/P&gt;&lt;P&gt;itab-percent = itab-amt / ptab-sum * 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andreas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Andreas Mann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jan 2007 13:37:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ask-abap-logic/m-p/1819362#M350363</guid>
      <dc:creator>andreas_mann3</dc:creator>
      <dc:date>2007-01-15T13:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: ask abap logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ask-abap-logic/m-p/1819363#M350364</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;thanks for the help. i will try out.&lt;/P&gt;&lt;P&gt;rgds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jan 2007 23:56:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ask-abap-logic/m-p/1819363#M350364</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-15T23:56:42Z</dc:date>
    </item>
  </channel>
</rss>

