<?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: calculating in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculating/m-p/4046114#M967192</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;do the following &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;consider all these records are in internal table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can first declare another internal table  itab1 simialr to itab with one more field precent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Loop at itab.&lt;/P&gt;&lt;P&gt;Itab1-pl = itab-pl.&lt;/P&gt;&lt;P&gt;Itab1-p.suba = itab-p.suba&lt;/P&gt;&lt;P&gt;Itab1-root-id = itab-root-id.&lt;/P&gt;&lt;P&gt;Itab1-orgeh = itab-orgeh.&lt;/P&gt;&lt;P&gt;Itab1-hj = itab-hj&lt;/P&gt;&lt;P&gt;Itab1-quota = itab-quota.&lt;/P&gt;&lt;P&gt;Collect itab1.----&lt;/P&gt;&lt;HR originaltext="-------------------" /&gt;&lt;P&gt;instead of append u can use collect. So it will add 72 and 92.&lt;/P&gt;&lt;P&gt;Clear itab1.&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab1.&lt;/P&gt;&lt;P&gt;Wa_precent = itab1-quota / 100.&lt;/P&gt;&lt;P&gt;Itab1-persent =  wa_precent.&lt;/P&gt;&lt;P&gt;Modify itab-precent index sy-tabix.&lt;/P&gt;&lt;P&gt;Clear itab1.&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;reward if useful.&lt;/P&gt;&lt;P&gt;diana.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Jun 2008 09:50:41 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-11T09:50:41Z</dc:date>
    <item>
      <title>calculating</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculating/m-p/4046108#M967186</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;&lt;/P&gt;&lt;P&gt;How can I implement this logic with abap ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
PNR PL  P.Suba  ROOT-ID   ORGEH     HJ  Quota
200	0001	0001	00012128	00012128	02	81
210	0001	0001	00012128	00012128	02	34
515	0001	0001	00012128	00012128	02	64
551	0001	0001	00012128	00012128	02	80
829	0001	0001	00011256	00011256	02	72
843	0001	0001	00011256	00011256	02	92
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in order to calculate OSHA it is necessary&lt;/P&gt;&lt;P&gt;to operate as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;1. Finding out number of personal per ORGEH
2. Add up the quoatas per ORGEH
   e.g.  ORGEH 00011256 = (72 + 92) / 100 
         Result =         1.62&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;         &lt;/P&gt;&lt;P&gt;Pls can somebody help me to perform above&lt;/P&gt;&lt;P&gt;shown logic with abap   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;ertas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 09:32:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculating/m-p/4046108#M967186</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T09:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: calculating</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculating/m-p/4046109#M967187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Loop at data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_total = w_total + data-quato_value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at end of ORGEH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_res = w_total / 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 09:36:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculating/m-p/4046109#M967187</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T09:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: calculating</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculating/m-p/4046110#M967188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what do you mean with w_total ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;ertas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 09:40:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculating/m-p/4046110#M967188</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T09:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: calculating</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculating/m-p/4046111#M967189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt; First move the data into one more table in that ORGEH should be the first field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;declaretiong of temp_table.
same as current_table but ORGEH will be the first field
loop at current_table.
 move-corresponding current_table into temp_table.
append temp_table.
endloop.

sort temp_table by orgeh.

loop at temp_table.
 add the quotas.
at end of orgeh.
 quota = quota / 100.
endat.
endloop..&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 09:42:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculating/m-p/4046111#M967189</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T09:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: calculating</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculating/m-p/4046112#M967190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Ertas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First create a internal  table with first  field  ORGEH  then other fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use events At new &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At NEW ORGEH.&lt;/P&gt;&lt;P&gt; loop at IT_tab.&lt;/P&gt;&lt;P&gt;v_total = wa_tab-Quota+v_total.&lt;/P&gt;&lt;P&gt;wa_finaloutput-Quota = v_tatal.&lt;/P&gt;&lt;P&gt;append  wa_finaloutput to IT_finaloutput.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end at .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 09:44:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculating/m-p/4046112#M967190</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T09:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: calculating</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculating/m-p/4046113#M967191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its a field to accumulate the values that you are adding, (72 + 92 for example).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 09:48:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculating/m-p/4046113#M967191</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T09:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: calculating</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculating/m-p/4046114#M967192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;do the following &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;consider all these records are in internal table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can first declare another internal table  itab1 simialr to itab with one more field precent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Loop at itab.&lt;/P&gt;&lt;P&gt;Itab1-pl = itab-pl.&lt;/P&gt;&lt;P&gt;Itab1-p.suba = itab-p.suba&lt;/P&gt;&lt;P&gt;Itab1-root-id = itab-root-id.&lt;/P&gt;&lt;P&gt;Itab1-orgeh = itab-orgeh.&lt;/P&gt;&lt;P&gt;Itab1-hj = itab-hj&lt;/P&gt;&lt;P&gt;Itab1-quota = itab-quota.&lt;/P&gt;&lt;P&gt;Collect itab1.----&lt;/P&gt;&lt;HR originaltext="-------------------" /&gt;&lt;P&gt;instead of append u can use collect. So it will add 72 and 92.&lt;/P&gt;&lt;P&gt;Clear itab1.&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab1.&lt;/P&gt;&lt;P&gt;Wa_precent = itab1-quota / 100.&lt;/P&gt;&lt;P&gt;Itab1-persent =  wa_precent.&lt;/P&gt;&lt;P&gt;Modify itab-precent index sy-tabix.&lt;/P&gt;&lt;P&gt;Clear itab1.&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;reward if useful.&lt;/P&gt;&lt;P&gt;diana.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 09:50:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculating/m-p/4046114#M967192</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T09:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: calculating</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculating/m-p/4046115#M967193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;say F1 , F2 as last two fields of ur list&lt;/P&gt;&lt;P&gt;put ORGEH as first field of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab by orgeh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:val1 type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:val2 type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;val1 = val1 + F2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at end of orgeh.&lt;/P&gt;&lt;P&gt;val2 = val1 / 100.&lt;/P&gt;&lt;P&gt;move corresponding itab to itab1.&lt;/P&gt;&lt;P&gt;itab1-result = val2.&lt;/P&gt;&lt;P&gt;clear val2.&lt;/P&gt;&lt;P&gt;clear val1.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 10:13:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculating/m-p/4046115#M967193</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2008-06-11T10:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: calculating</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculating/m-p/4046116#M967194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ,&lt;/P&gt;&lt;P&gt;thanks for rewarding . is yr problem solved?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,.&lt;/P&gt;&lt;P&gt;diana.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 11:10:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculating/m-p/4046116#M967194</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T11:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: calculating</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculating/m-p/4046117#M967195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kumar At NEW ist allowed only within LOOP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 12:01:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculating/m-p/4046117#M967195</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T12:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: calculating</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculating/m-p/4046118#M967196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;without a loop u cannot acheive this..&lt;/P&gt;&lt;P&gt;There is multiple records&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 12:17:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculating/m-p/4046118#M967196</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2008-06-11T12:17:33Z</dc:date>
    </item>
  </channel>
</rss>

