<?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: Class with only static methodes? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-with-only-static-methodes/m-p/8637728#M1665459</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suhas,&lt;/P&gt;&lt;P&gt;Sorry for my late reply. As the OP asked, &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;I want this class because we are using &lt;/SPAN&gt;&lt;STRONG style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;same select statements&lt;/STRONG&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; background-color: #ffffff; color: #333333; text-decoration: underline;"&gt;several times&lt;/SPAN&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt; in &lt;/SPAN&gt;&lt;EM style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;different methodes&lt;/EM&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What I feel was, he could have create a class using singleton DP, and for the first time, fetch the data from DB and store in the attributes of that instance. Now when he wants the data again, he can check whether the instance is bound or not. if it is bound, he can avoid hitting DB! &lt;/P&gt;&lt;P&gt;Correct me if you feel it is wrong.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Mar 2012 10:40:10 GMT</pubDate>
    <dc:creator>Kiran_Valluru</dc:creator>
    <dc:date>2012-03-20T10:40:10Z</dc:date>
    <item>
      <title>Class with only static methodes?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-with-only-static-methodes/m-p/8637723#M1665454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;is there a disadvantage if i create a class with only static methodes. I don't need to create object, just use static methodes.&lt;/P&gt;&lt;P&gt;I want this class because we are using &lt;STRONG&gt;same select statements&lt;/STRONG&gt; &lt;SPAN style="text-decoration: underline;"&gt;several times&lt;/SPAN&gt; in &lt;EM&gt;different methodes&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;tnx. Adibo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2012 09:45:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-with-only-static-methodes/m-p/8637723#M1665454</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-19T09:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Class with only static methodes?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-with-only-static-methodes/m-p/8637724#M1665455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Adibo,&lt;/P&gt;&lt;P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;is there a disadvantage if i create a class with only static methodes. I don't need to create object, just use static methodes.&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;&lt;P&gt;If you really don't need to store results for further calls, IMO there are no &lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;disadvantage&lt;/SPAN&gt;s.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;I want this class because we are using &lt;/SPAN&gt;&lt;STRONG style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;same select statements&lt;/STRONG&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; background-color: #ffffff; color: #333333; text-decoration: underline;"&gt;several times&lt;/SPAN&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt; in &lt;/SPAN&gt;&lt;EM style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;different methodes&lt;/EM&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I don't really understand your needs, but I thinks this is not important for my 1st answer &lt;SPAN __jive_emoticon_name="wink" __jive_macro_name="emoticon" class="jive_macro jive_macro_emoticon jive_emote" src="https://community.sap.com/5.0.1/images/emoticons/wink.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;&lt;A __default_attr="173998" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://community.sap.com/"&gt;&lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2012 12:42:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-with-only-static-methodes/m-p/8637724#M1665455</guid>
      <dc:creator>UweFetzer_se38</dc:creator>
      <dc:date>2012-03-19T12:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: Class with only static methodes?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-with-only-static-methodes/m-p/8637725#M1665456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;I want this class because we are using &lt;/SPAN&gt;&lt;STRONG style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;same select statements&lt;/STRONG&gt;&lt;SPAN style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; background-color: #ffffff; color: #333333; text-decoration: underline;"&gt;several times&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt; in&lt;/SPAN&gt;&lt;EM style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;different methodes&lt;/EM&gt;&lt;SPAN style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this, you can create a class using singleton design pattern, and create static attributes( table types) to store date from DB and you can access those attributes. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps u.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2012 13:27:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-with-only-static-methodes/m-p/8637725#M1665456</guid>
      <dc:creator>Kiran_Valluru</dc:creator>
      <dc:date>2012-03-19T13:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Class with only static methodes?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-with-only-static-methodes/m-p/8637726#M1665457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;kiran kumar Reddy wrote:&lt;/P&gt;&lt;P&gt;For this, you can create a class using singleton design pattern, and create static attributes( table types) to store date from DB and you can access those attributes.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why? &lt;SPAN __jive_emoticon_name="confused" __jive_macro_name="emoticon" class="jive_macro jive_macro_emoticon jive_emote" src="https://community.sap.com/5.0.1/images/emoticons/confused.gif"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Singleton DP is implemented if you want to use the &lt;EM style="text-decoration: underline;"&gt;same instance&lt;/EM&gt; of a class through out your application. If i understand correctly the OP doesn't need to work with an instance of the class, so why Singleton, please enlighten us?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2012 14:47:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-with-only-static-methodes/m-p/8637726#M1665457</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2012-03-19T14:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: Class with only static methodes?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-with-only-static-methodes/m-p/8637727#M1665458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Adibo A wrote:&lt;/P&gt;&lt;P&gt;is there a disadvantage if i create a class with only static methodes. I don't need to create object, just use static methodes.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;There is not disadvantage. If you are storing something in STATIC attributes, than you need to pay extra attention while clearing them. Otherwise, this method would be simply an Utility method which accepts the input and gives back the output.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;I want this class because we are using &lt;STRONG&gt;same select statements&lt;/STRONG&gt; &lt;SPAN style="text-decoration: underline;"&gt;several times&lt;/SPAN&gt; in &lt;EM&gt;different methodes&lt;/EM&gt;.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Are these methods being called&amp;nbsp; in the same LUW or Session with Same input parameter with same expected Output? If yes, than you should consider Singleton DP.&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2012 15:13:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-with-only-static-methodes/m-p/8637727#M1665458</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2012-03-19T15:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: Class with only static methodes?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-with-only-static-methodes/m-p/8637728#M1665459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suhas,&lt;/P&gt;&lt;P&gt;Sorry for my late reply. As the OP asked, &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;I want this class because we are using &lt;/SPAN&gt;&lt;STRONG style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;same select statements&lt;/STRONG&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; background-color: #ffffff; color: #333333; text-decoration: underline;"&gt;several times&lt;/SPAN&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt; in &lt;/SPAN&gt;&lt;EM style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;different methodes&lt;/EM&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What I feel was, he could have create a class using singleton DP, and for the first time, fetch the data from DB and store in the attributes of that instance. Now when he wants the data again, he can check whether the instance is bound or not. if it is bound, he can avoid hitting DB! &lt;/P&gt;&lt;P&gt;Correct me if you feel it is wrong.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2012 10:40:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-with-only-static-methodes/m-p/8637728#M1665459</guid>
      <dc:creator>Kiran_Valluru</dc:creator>
      <dc:date>2012-03-20T10:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Class with only static methodes?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-with-only-static-methodes/m-p/8637729#M1665460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Tnx all, for the answers!!&lt;/P&gt;&lt;P&gt;@Patel, method could be called in the same LUW but I don expect the same output.&lt;/P&gt;&lt;P&gt;I'am just using static methods to reduce some code and to prevent writing same select statement over and over again..&lt;/P&gt;&lt;P&gt;See my code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;zCL_STATIC_METHODS&lt;/P&gt;&lt;/CODE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;GET_ZAKENPARTNER_SOORT&lt;/TD&gt;&lt;TD&gt;Static Method&lt;/TD&gt;&lt;TD&gt;Public&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;Get Zakenpartner Soort'&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;I_PARTNER&lt;/TD&gt;&lt;TD&gt;Importing&lt;/TD&gt;&lt;TD&gt;Type&lt;/TD&gt;&lt;TD&gt;BU_PARTNER&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;Nummer zakenpartner&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;E_TEXT&lt;/TD&gt;&lt;TD&gt;Exporting&lt;/TD&gt;&lt;TD&gt;Type&lt;/TD&gt;&lt;TD&gt;BU_TEXT40&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;Omschrijving&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;METHOD&lt;/SPAN&gt; get_zakenpartner_soort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L1S52"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN class="L1S52"&gt;SINGLE&lt;/SPAN&gt; tb004t~text40 &lt;SPAN class="L1S52"&gt;INTO&lt;/SPAN&gt; e_text&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L1S52"&gt;FROM&lt;/SPAN&gt; but000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; INNER &lt;SPAN class="L1S52"&gt;JOIN&lt;/SPAN&gt; tb004t &lt;SPAN class="L1S52"&gt;ON&lt;/SPAN&gt; but000~bpkind &lt;SPAN class="L1S52"&gt;EQ&lt;/SPAN&gt; tb004t~bpkind&amp;nbsp; &lt;SPAN class="L1S31"&gt;"#EC CI_BUFFJOIN&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L1S52"&gt;WHERE&lt;/SPAN&gt; but000~partner &lt;SPAN class="L1S52"&gt;EQ&lt;/SPAN&gt; i_partner.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L1S52"&gt;ENDMETHOD&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And i call it like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;REPORT&lt;/SPAN&gt;&amp;nbsp; z_static_call.&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L1S52"&gt;DATA&lt;/SPAN&gt;: lv_text &lt;SPAN class="L1S52"&gt;TYPE&lt;/SPAN&gt; bu_text40.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; zcl_static_methods=&amp;gt;get_zakenpartner_soort(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L1S52"&gt;EXPORTING &lt;/SPAN&gt;i_partner = &lt;SPAN class="L1S33"&gt;'0010000278'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L1S52"&gt;IMPORTING &lt;/SPAN&gt;e_text&amp;nbsp;&amp;nbsp;&amp;nbsp; = lv_text ).&lt;/P&gt;&lt;P&gt; BREAK-POINT.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As simple as that. &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/5.0.1/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2012 10:40:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-with-only-static-methodes/m-p/8637729#M1665460</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-20T10:40:48Z</dc:date>
    </item>
  </channel>
</rss>

