<?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: construcors in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/construcors/m-p/3794758#M912686</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please read these: [http://help.sap.com/saphelp_nw2004s/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm] and&lt;/P&gt;&lt;P&gt;[http://help.sap.com/saphelp_nw2004s/helpdata/en/c3/225b6554f411d194a60000e8353423/content.htm].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 May 2008 12:04:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-16T12:04:19Z</dc:date>
    <item>
      <title>construcors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/construcors/m-p/3794757#M912685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hai friends.....&lt;/P&gt;&lt;P&gt;   can anybody tell me about constructors  .when wil be the exact use of instance and static methods and attributs will be occursd..&lt;/P&gt;&lt;P&gt; plz tell me exact real scanario where it occurs /////////&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; thankx in advance...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2008 11:47:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/construcors/m-p/3794757#M912685</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-16T11:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: construcors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/construcors/m-p/3794758#M912686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please read these: [http://help.sap.com/saphelp_nw2004s/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm] and&lt;/P&gt;&lt;P&gt;[http://help.sap.com/saphelp_nw2004s/helpdata/en/c3/225b6554f411d194a60000e8353423/content.htm].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2008 12:04:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/construcors/m-p/3794758#M912686</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-16T12:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: construcors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/construcors/m-p/3794759#M912687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Satya Vani,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Constructors are special PUBLIC methods that are triggered when an object is instantiated from a class. They are necessary when you want to set the initial state of an object dynamically. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like normal methods, there are two types of constructor - instance constructors and static constructors. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To use the instance constructor, the CONSTRUCTOR method must be declared in the public section of the class using the METHODS statement, and implemented in the implementation section.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Constructors must always be declared in the PUBLIC section of a class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Static Constructor&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  YSUBOOPS2.&lt;/P&gt;&lt;P&gt;CLASS c1 DEFINITION .&lt;/P&gt;&lt;P&gt;PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;CLASS-DATA : NUM TYPE I VALUE 5.&lt;/P&gt;&lt;P&gt;CLASS-METHODS:CLASS_CONSTRUCTOR.&lt;/P&gt;&lt;P&gt; ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS c1 IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;METHOD CLASS_CONSTRUCTOR.&lt;/P&gt;&lt;P&gt; WRITE:/5 'I am class constructor'.&lt;/P&gt;&lt;P&gt;ENDMETHOD.&lt;/P&gt;&lt;P&gt; ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;   WRITE:/5 C1=&amp;gt;NUM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Static methods,&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Static methods declared as  CLASS-METHODS : CLASS_CONSTRUCTOR  in the public section of the class definition and are also implemented in the implementation part. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call a static method : [CALL METHOD] class=&amp;gt;meth. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addressing a static attribute with class=&amp;gt;a. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simple program will show you that  instance constructor methods of a class get triggered when an object is created from the class.&lt;/P&gt;&lt;P&gt;REPORT  YSUBOOPS1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS C1 DEFINITION.&lt;/P&gt;&lt;P&gt; PUBLIC SECTION.&lt;/P&gt;&lt;P&gt; METHODS : CONSTRUCTOR .&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CLASS C1 IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;P&gt;   WRITE:/5 'I am constructor'.&lt;/P&gt;&lt;P&gt;   skip 2.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;DATA: obj1 TYPE REF TO c1.&lt;/P&gt;&lt;P&gt;CREATE OBJECT: obj1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2008 12:27:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/construcors/m-p/3794759#M912687</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-16T12:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: construcors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/construcors/m-p/3794760#M912688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Satya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take a look at this link  [ABAP Objects - Creating your First Local Class - Using Instance Constructor|https://wiki.sdn.sap.com/wiki/x/0dg], it's  explaining how to use Instance Contructor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marcelo Ramos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2008 13:41:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/construcors/m-p/3794760#M912688</guid>
      <dc:creator>marcelo_ramos1</dc:creator>
      <dc:date>2008-05-16T13:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: construcors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/construcors/m-p/3794761#M912689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Hi Satya Vani,&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Constructors are special PUBLIC methods that are triggered when an object is instantiated from a class. They are necessary when you want to set the initial state of an object dynamically. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Suresh&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Not quite&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: lo_obj TYPE REF myclass.
CREATE  OBJECT lo_obj. " EXPORTING parameters may follow.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the above is executed the constructor of the class myclass is run.  If no method CONSTRUCTOR is defined, then a reference to an object of type myclass is returned.  In such cases, there are no parameters.  You can, however, define in the class a method called CONSTRUCTOR (with none or many importing parameters).  If such a method exists, then the create object command will run the constructor method and return an instance of the class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is possible, however, that instantiation is private.  That means that the CONSTRUCTOR is private.  In such instances the return of new references to a caller is handled through what is know as a factory class.  This is a static class that has within its implementation a CREATE OBJECT of myclass.  It returns the reference to the object.  Used when implementing the singleton pattern and various other scenarios.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 May 2008 17:12:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/construcors/m-p/3794761#M912689</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2008-05-18T17:12:01Z</dc:date>
    </item>
  </channel>
</rss>

