<?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: OO Question? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-question/m-p/2621312#M601998</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;It all depends on what you are looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the first instace you are creating a object of that class..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let us say you are doing some calculations which are stored in the class attributes.. in this case these values are specific to the object that you are accessing.&lt;/P&gt;&lt;P&gt;let us say you have two methods..&lt;/P&gt;&lt;P&gt;save_data.. to save data into a attribute of the class.&lt;/P&gt;&lt;P&gt;after some time you say call display_data.. if you dont have a object reference then now way you can get the attributes value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and if you feel that you just want to use the methods of a class and got nothing to do with the conent of the attributes of the class then you can do call a method by taking class reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;normally static methods are called with class reference &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Jul 2007 20:54:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-26T20:54:03Z</dc:date>
    <item>
      <title>OO Question?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-question/m-p/2621310#M601996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any reason to do this in a program:&lt;/P&gt;&lt;P&gt;DATA: o_zcl_icg_calculations TYPE REF TO zcl_icg_calculations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CREATE OBJECT o_zcl_icg_calculations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD o_zcl_icg_calculations-&amp;gt;calc_wettons_unit_price&lt;/P&gt;&lt;P&gt;                EXPORTING&lt;/P&gt;&lt;P&gt;                   zunit_price_reg      = unit_price&lt;/P&gt;&lt;P&gt;                IMPORTING&lt;/P&gt;&lt;P&gt;                   z_wettons_unit_price = g_wettons_unit_price.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;********************************************************************&lt;/P&gt;&lt;P&gt;Why not just do this....any reason?:&lt;/P&gt;&lt;P&gt;CALL METHOD zcl_icg_calculations-&amp;gt;calc_wettons_unit_price&lt;/P&gt;&lt;P&gt;                EXPORTING&lt;/P&gt;&lt;P&gt;                   zunit_price_reg      = unit_price&lt;/P&gt;&lt;P&gt;                IMPORTING&lt;/P&gt;&lt;P&gt;                   z_wettons_unit_price = g_wettons_unit_price.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2007 20:48:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-question/m-p/2621310#M601996</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-26T20:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: OO Question?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-question/m-p/2621311#M601997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the code in method "zcl_icg_calculations" &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2007 20:52:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-question/m-p/2621311#M601997</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-07-26T20:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: OO Question?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-question/m-p/2621312#M601998</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;It all depends on what you are looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the first instace you are creating a object of that class..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let us say you are doing some calculations which are stored in the class attributes.. in this case these values are specific to the object that you are accessing.&lt;/P&gt;&lt;P&gt;let us say you have two methods..&lt;/P&gt;&lt;P&gt;save_data.. to save data into a attribute of the class.&lt;/P&gt;&lt;P&gt;after some time you say call display_data.. if you dont have a object reference then now way you can get the attributes value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and if you feel that you just want to use the methods of a class and got nothing to do with the conent of the attributes of the class then you can do call a method by taking class reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;normally static methods are called with class reference &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2007 20:54:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-question/m-p/2621312#M601998</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-26T20:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: OO Question?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-question/m-p/2621313#M601999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To do what you suggest, method should be a class one (not an instance one), thus you should use =&amp;gt; operator instead of -&amp;gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2007 01:14:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-question/m-p/2621313#M601999</guid>
      <dc:creator>alejandro_bindi</dc:creator>
      <dc:date>2007-07-27T01:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: OO Question?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-question/m-p/2621314#M602000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom, if your question is related to .... why create an instance method over a static method, or vice-versa, it all depends on the application.  In a case, where you have a simple utility method, where you pass something, it does something, and gives you a result, then there is no reason why it couldn't just be a static method.  But if you are manipulating instance attributes of the class, then it should be an instance method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in your case, if the method implementation is just doing something with that value that you are passing and giving a result, then sure the method could be defined as a static method, the you can simply call it directly instead of creating an instance first.  But again, the method must be defined as "Static"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL METHOD zcl_icg_calculations=&amp;gt;calc_wettons_unit_price
EXPORTING
zunit_price_reg = unit_price
IMPORTING
z_wettons_unit_price = g_wettons_unit_price.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2007 01:42:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-question/m-p/2621314#M602000</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-07-27T01:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: OO Question?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-question/m-p/2621315#M602001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rich...I wasn't able to reward any points. Your explanation and others was very good. I never has a reason yet to use attributes. I guess the system won't let you allow points after a certain amount of time of the posting, if I could I would?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2007 13:20:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-question/m-p/2621315#M602001</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-27T13:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: OO Question?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-question/m-p/2621316#M602002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No problem, not sure why you can't, but if you want, I can award the others for there answers here(I can't award myself).  If you want to award some points to the others, then just let me know.  Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2007 13:26:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-question/m-p/2621316#M602002</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-07-27T13:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: OO Question?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-question/m-p/2621317#M602003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like I could issue points after all....Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2007 13:40:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-question/m-p/2621317#M602003</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-27T13:40:38Z</dc:date>
    </item>
  </channel>
</rss>

