<?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: Reg : constructors in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors/m-p/4142992#M990535</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;I think you cannot "see" (or debug) the implicit CONSTRUCTOR method.&lt;/P&gt;&lt;P&gt;Why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have a table type (e.g. SWF_UTL_OBJECT_TAB) in your SAP system which has as structure REFERENCE TYPE to OBJECT (= root object of all ABAP classes) you will see why.&lt;/P&gt;&lt;P&gt;When you double-click on OBJECT you will not see the class OBJECT (in SE24) but receive the message &lt;EM&gt;"OBJECT is a type that is predefined in ABAP".&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway it would not be very exciting to debug the implicit instantiation because nothing happens except for the instantiation of your class (no presetting of attributes etc. because OBJECT as super-class has no attributes).&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>Mon, 21 Jul 2008 05:22:51 GMT</pubDate>
    <dc:creator>uwe_schieferstein</dc:creator>
    <dc:date>2008-07-21T05:22:51Z</dc:date>
    <item>
      <title>Reg : constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors/m-p/4142987#M990530</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;Could we apply the same concept of Constructors in JAVA for ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I learned the point that Constructors help in creating the object but doesnot create the object.&lt;/P&gt;&lt;P&gt;But without constructor its not possible  to create objects .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the above point same in ABAP.?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;System will introduce constructors at the time of object creation. How can I see the constructor induced?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2008 05:00:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors/m-p/4142987#M990530</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-21T05:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Reg : constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors/m-p/4142988#M990531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hii!&lt;/P&gt;&lt;P&gt; It is true that constructor helps in creating objects. But its false that without constructor you can't create object&lt;/P&gt;&lt;P&gt; Read this&lt;/P&gt;&lt;P&gt;Instance Constructor = The constructor is a special instance method in a class and is always named CONSTRUCTOR.&lt;/P&gt;&lt;P&gt;The constructor is automatically called at runtime with CREATE OBJECT statement.&lt;/P&gt;&lt;P&gt;Some Important points about constructor:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each class can have only one constructor. &lt;/P&gt;&lt;P&gt;The constructor must be defined in PUBLIC SECTION. &lt;/P&gt;&lt;P&gt;The constructor's signature can have only importing parameters and exceptions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When exceptions are raised in the constructor, instances are not created so no main memory is occupied. &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>Mon, 21 Jul 2008 05:05:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors/m-p/4142988#M990531</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-21T05:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: Reg : constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors/m-p/4142989#M990532</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;If an ABAP class has an &lt;STRONG&gt;explicit&lt;/STRONG&gt; CONSTRUCTOR method it is called when the CREATE OBJECT &amp;lt;abap class&amp;gt; statement occurs.&lt;/P&gt;&lt;P&gt;Without an explicit CONSTRUCTOR method the &lt;STRONG&gt;implicit&lt;/STRONG&gt; CONSTRUCTOR of the root class OBJECT is called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus, the concepts of creating object instances is the same in ABAP and Java.&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>Mon, 21 Jul 2008 05:07:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors/m-p/4142989#M990532</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-07-21T05:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Reg : constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors/m-p/4142990#M990533</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;Plz refer to the link and read the Constructor section.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://searchsap.techtarget.com/tip/0,289483,sid21_gci1270269,00.html" target="test_blank"&gt;http://searchsap.techtarget.com/tip/0,289483,sid21_gci1270269,00.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sumit Agarwal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2008 05:13:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors/m-p/4142990#M990533</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-21T05:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Reg : constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors/m-p/4142991#M990534</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;So constructors help in creating objects and without it we cannot create objects. am I right Uwe Schieferstein &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;and what about my second que?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;System will introduce implicit  constructors at the time of object creation. How can I see the constructor induced?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz help me yar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2008 05:14:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors/m-p/4142991#M990534</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-21T05:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Reg : constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors/m-p/4142992#M990535</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;I think you cannot "see" (or debug) the implicit CONSTRUCTOR method.&lt;/P&gt;&lt;P&gt;Why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have a table type (e.g. SWF_UTL_OBJECT_TAB) in your SAP system which has as structure REFERENCE TYPE to OBJECT (= root object of all ABAP classes) you will see why.&lt;/P&gt;&lt;P&gt;When you double-click on OBJECT you will not see the class OBJECT (in SE24) but receive the message &lt;EM&gt;"OBJECT is a type that is predefined in ABAP".&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway it would not be very exciting to debug the implicit instantiation because nothing happens except for the instantiation of your class (no presetting of attributes etc. because OBJECT as super-class has no attributes).&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>Mon, 21 Jul 2008 05:22:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors/m-p/4142992#M990535</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-07-21T05:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: Reg : constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors/m-p/4142993#M990536</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;So constructors help in creating objects and without it we cannot create objects. am I right Uwe Schieferstein &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please answer my que,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and one more help could you provide me a scenario/example where explicit constructor is mandatory to use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2008 06:00:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors/m-p/4142993#M990536</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-21T06:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: Reg : constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors/m-p/4142994#M990537</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;Technically the CONSTRUCTOR method is optional.&lt;/P&gt;&lt;P&gt;However, if you want to set certain attributes of your instance once and for all then the CONSTRUCTOR is &lt;STRONG&gt;semantically mandatory&lt;/STRONG&gt; because it is the very first method to be called and it is called once and only once.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example: You have a class dealing with purchase orders. In this case your class should have a CONSTRUCTOR method with an IMPORTING parameter ID_PO_NUMBER. The instance attribute &amp;lt;class name&amp;gt;-&amp;gt;MD_PO_NUMBER may be public but must be &lt;EM&gt;read-only&lt;/EM&gt; because otherwise you could change the identity of the instance during runtime.&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>Mon, 21 Jul 2008 06:06:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors/m-p/4142994#M990537</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-07-21T06:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Reg : constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors/m-p/4142995#M990538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;      You can very well relate the constructor concept in JAVA with ABAP Objects, with the exception that in JAVA, there is no static constructor; atleast not open to developers. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope everyone agrees with me. Is there any place in JAVA where you can write logic when a class is instantiated for the first time? Maybe you can write it in a normal constructor with some condition so that it gets executed only for the first instance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise, the instance constructor in ABAP Objects works the same way as the constructor in JAVA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Experts, please correct me if I'm wrong.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2008 11:47:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors/m-p/4142995#M990538</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-21T11:47:48Z</dc:date>
    </item>
  </channel>
</rss>

