<?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 Constructor in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/constructor/m-p/3338319#M800254</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is constructor in Abap objects. Please explain with example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 27 Jan 2008 09:21:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-27T09:21:33Z</dc:date>
    <item>
      <title>Constructor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constructor/m-p/3338319#M800254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is constructor in Abap objects. Please explain with example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Jan 2008 09:21:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constructor/m-p/3338319#M800254</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-27T09:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Constructor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constructor/m-p/3338320#M800255</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;&lt;STRONG&gt;Constructor method&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    Implicitly, each class has an instance constructor method with the reserved name constructor and a static constructor method with the reserved name class_constructor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The instance constructor is executed each time you create an object (instance) with the CREATE OBJECT statement, while the class constructor is executed exactly once before you first access a class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The constructors are always present. However, to implement a constructor you must declare it explicitly with the METHODS or CLASS-METHODS statements. An instance constructor can have IMPORTING parameters and exceptions. You must pass all non-optional parameters when creating an object. Static constructors have no parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Static constructor&lt;/P&gt;&lt;P&gt;The static constructor is always called CLASS_CONSTRUCTER, and is called autmatically before the clas is first accessed, that is before any of the following actions are executed:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Creating an instance using CREATE_OBJECT&lt;/P&gt;&lt;P&gt;2) Adressing a static attribute using &amp;lt;classname&amp;gt;-&amp;gt;&amp;lt;attrbute&amp;gt;&lt;/P&gt;&lt;P&gt;3) Calling a ststic attribute using CALL METHOD&lt;/P&gt;&lt;P&gt;4) Registering a static event handler&lt;/P&gt;&lt;P&gt;5) Registering an evetm handler method for a static event&lt;/P&gt;&lt;P&gt;The static constructor cannot be called explicitly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check out this link for example program using constructor...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.erpgenie.com/abap/OO/eg.htm#Use" target="test_blank"&gt;http://www.erpgenie.com/abap/OO/eg.htm#Use&lt;/A&gt; constructor to create an object with parameters&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;&lt;STRONG&gt;Reward points if useful&lt;/STRONG&gt; **&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shanthi.P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Jan 2008 09:39:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constructor/m-p/3338320#M800255</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-27T09:39:40Z</dc:date>
    </item>
  </channel>
</rss>

