<?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  Constructors and instance Constructors in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/static-constructors-and-instance-constructors/m-p/4287595#M1022744</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi vijay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need functinal scenarios . means... example  requirement   at which we define these two constuctors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;sravan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Aug 2008 14:15:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-08-04T14:15:04Z</dc:date>
    <item>
      <title>static  Constructors and instance Constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/static-constructors-and-instance-constructors/m-p/4287592#M1022741</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;where should we use static Constructors and where should we use instance Constructors  . &lt;/P&gt;&lt;P&gt;can any one help me with the proper  scenarios.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;&amp;lt;removed by moderator&amp;gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks and best regards,&lt;/P&gt;&lt;P&gt;sravan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Mike Pokraka on Aug 3, 2008 6:04 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Aug 2008 13:51:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/static-constructors-and-instance-constructors/m-p/4287592#M1022741</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-03T13:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: static  Constructors and instance Constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/static-constructors-and-instance-constructors/m-p/4287593#M1022742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In this Forum it is Discussed many times, use Search Option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and Before posting a Question, Read the rules .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this:-&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vijay Babu Dudla&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Aug 2008 14:03:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/static-constructors-and-instance-constructors/m-p/4287593#M1022742</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-03T14:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: static  Constructors and instance Constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/static-constructors-and-instance-constructors/m-p/4287594#M1022743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sravan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same questions were discussed recently: &lt;SPAN __jive_macro_name="thread" id="986792"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Aug 2008 19:52:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/static-constructors-and-instance-constructors/m-p/4287594#M1022743</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-08-03T19:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: static  Constructors and instance Constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/static-constructors-and-instance-constructors/m-p/4287595#M1022744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi vijay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need functinal scenarios . means... example  requirement   at which we define these two constuctors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;sravan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2008 14:15:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/static-constructors-and-instance-constructors/m-p/4287595#M1022744</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-04T14:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: static  Constructors and instance Constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/static-constructors-and-instance-constructors/m-p/4287596#M1022745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Aug 2008 09:47:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/static-constructors-and-instance-constructors/m-p/4287596#M1022745</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-07T09:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: static  Constructors and instance Constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/static-constructors-and-instance-constructors/m-p/4287597#M1022746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sravan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please got through the links ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.thaiabap.com/index.php?option=com_content&amp;amp;view=article&amp;amp;id=2043" target="test_blank"&gt;http://www.thaiabap.com/index.php?option=com_content&amp;amp;view=article&amp;amp;id=2043&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.slideshare.net/srinatha/oo-abap-sap/" target="test_blank"&gt;http://www.slideshare.net/srinatha/oo-abap-sap/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.geocities.com/rmtiwari/Resources/Utilities/ABAPReference/ABENCONSTRUCTOR.htm" target="test_blank"&gt;http://www.geocities.com/rmtiwari/Resources/Utilities/ABAPReference/ABENCONSTRUCTOR.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-press.de/katalog/buecher/htmlleseproben/gp/htmlprobID-28" target="test_blank"&gt;http://www.sap-press.de/katalog/buecher/htmlleseproben/gp/htmlprobID-28&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sreekar.Kadiri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Aug 2008 10:01:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/static-constructors-and-instance-constructors/m-p/4287597#M1022746</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-07T10:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: static  Constructors and instance Constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/static-constructors-and-instance-constructors/m-p/4287598#M1022747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hii!&lt;/P&gt;&lt;P&gt;  Instance constructor is a special instance method in a class and is always named CONSTRUCTOR.&lt;/P&gt;&lt;P&gt;These constructors are necessary after the instanctiation of class:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;If you need to allocate the resources&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;You need to initialize attributes that cannot be covered by the VALUE addition to the DATA statement.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;You need to send messages containing the information that a new object was created.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Static constructor is called automatically before the class is first accessed. This means that you can use this constructor if you want some values just before the class is first accessed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone has better answer. Please come forward.&lt;/P&gt;&lt;P&gt;Even I want to know more about static constructors&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Abhijeet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Aug 2008 10:02:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/static-constructors-and-instance-constructors/m-p/4287598#M1022747</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-07T10:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: static  Constructors and instance Constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/static-constructors-and-instance-constructors/m-p/4287599#M1022748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Static constructors in ABAP are called Class Constructors.  I use them when I want to initialise some static attributes for later use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, if I was writing a class to handle materials, I might define an internal table as a static attribute to hold of MAKT.  Then when I wanted to get a material description, I'd go to the static attribute and read that, but first, I'd have to check whether it was populated.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF sth_makt IS INITIAL.
  SELECT * FROM makt INTO TABLE sth_makt WHERE spras = sy-langu.
ENDIF.
READ TABLE sth_makt ASSIGNING &amp;lt;ls_makt&amp;gt; WITH TABLE KEY matnr = i_matnr.
...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;  And I'd have to do this everywhere I want to read sth_makt, and their could be a risk if someone is extending my class, or I'm enhancing it later, that I forget to check whether the table is filled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I put the select in the Class constructor, I don't have to worry about any check, safe in the knowledge that whenever I want to READ makt, it will already be populated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Aug 2008 11:13:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/static-constructors-and-instance-constructors/m-p/4287599#M1022748</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2008-08-07T11:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: static  Constructors and instance Constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/static-constructors-and-instance-constructors/m-p/4287600#M1022749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks alot Matthew!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Aug 2008 12:07:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/static-constructors-and-instance-constructors/m-p/4287600#M1022749</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-07T12:07:01Z</dc:date>
    </item>
  </channel>
</rss>

