<?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: Static Method to calculate ' Average '. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/static-method-to-calculate-average/m-p/10482040#M1850317</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pawan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You`d better declare a another object, say 'Accountant', in this object, have a method used to calculating average, which importing parameters is a itab. In this itab, havd appended this two companies. I think no mater this calculating average method is static or instance, it`s ok, that`s depened on you how to abstract 'Accountant'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, static method has a small memory footprint than instance .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Archer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Aug 2014 02:16:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-08-08T02:16:25Z</dc:date>
    <item>
      <title>Static Method to calculate ' Average '.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/static-method-to-calculate-average/m-p/10482039#M1850316</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;I am wondering which one is preferred?&amp;nbsp; Static or Instance methods for calculating 'average' (e.g average sales).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My class lcl_company is having attributes name and sales. which represents name = name of the company, sales = total sales of one company under department: automobiles.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Department: automobiles.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;name = abc company&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sales = 1000&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;name = xyz company&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sales = 2000&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;total companies added: 2.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now i want to calculate the average sales of the companies under department automobiles.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I prefer using a static method (is it good choice), if not, why instance method. while using the static method, I noticed that i need to stick just with the defined attributes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advice on calculating average.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Aug 2014 20:30:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/static-method-to-calculate-average/m-p/10482039#M1850316</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-08-07T20:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Static Method to calculate ' Average '.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/static-method-to-calculate-average/m-p/10482040#M1850317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pawan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You`d better declare a another object, say 'Accountant', in this object, have a method used to calculating average, which importing parameters is a itab. In this itab, havd appended this two companies. I think no mater this calculating average method is static or instance, it`s ok, that`s depened on you how to abstract 'Accountant'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, static method has a small memory footprint than instance .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Archer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Aug 2014 02:16:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/static-method-to-calculate-average/m-p/10482040#M1850317</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-08-08T02:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Static Method to calculate ' Average '.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/static-method-to-calculate-average/m-p/10482041#M1850318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Archer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Aug 2014 10:27:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/static-method-to-calculate-average/m-p/10482041#M1850318</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-08-08T10:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Static Method to calculate ' Average '.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/static-method-to-calculate-average/m-p/10482042#M1850319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi archer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did the same as you told.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i brought the two company into an it_tab which i defined as attribute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;private section.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data it_tab type table of ref to department.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my internal table is showing the records of both the companies but m face a new problem how to write this records to output.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Aug 2014 12:46:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/static-method-to-calculate-average/m-p/10482042#M1850319</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-08-08T12:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: Static Method to calculate ' Average '.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/static-method-to-calculate-average/m-p/10482043#M1850320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pawan,&lt;/P&gt;&lt;P&gt;There are so many ways,:&lt;/P&gt;&lt;P&gt;One, as you said, you defined this itab as a attribute of this Object, then you need define another attribute 'AverNum' as public. Of cause, this Object have a method using to calculate the average number, passing the value to public attribute 'AverNum', then you can access this public attribute from outside.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another way:&amp;nbsp; Define this itab as a importing parameter of your &lt;SPAN style="color: #333333; font-size: 12px;"&gt;average method&lt;/SPAN&gt;, same time, this average method have a return parameter. Then you can call this static object method or instance object method from outside, and return your output by return parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Archer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Aug 2014 16:20:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/static-method-to-calculate-average/m-p/10482043#M1850320</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-08-10T16:20:11Z</dc:date>
    </item>
  </channel>
</rss>

