<?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: constructor in ooabap in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/constructor-in-ooabap/m-p/3967023#M947571</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Learn to search.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Jun 2008 10:58:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-11T10:58:46Z</dc:date>
    <item>
      <title>constructor in ooabap</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constructor-in-ooabap/m-p/3967022#M947570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what is the functionality of the constructor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what is the diff b/w static and instance constructor.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 10:57:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constructor-in-ooabap/m-p/3967022#M947570</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T10:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: constructor in ooabap</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constructor-in-ooabap/m-p/3967023#M947571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Learn to search.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 10:58:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constructor-in-ooabap/m-p/3967023#M947571</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T10:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: constructor in ooabap</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constructor-in-ooabap/m-p/3967024#M947572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Constructor is the method which will be triggered when you create the object(system identifies and calls the method). Here you can pass import params only, and you can give exceptions also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Static constructor is the method which will trigger before creating the Object. here you cannot pass any parameters to the static method. you can use only static variables inside it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 11:01:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constructor-in-ooabap/m-p/3967024#M947572</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T11:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: constructor in ooabap</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constructor-in-ooabap/m-p/3967025#M947573</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;It's like the event initialization:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- the instance constructor: it's triggered as soon as an object (instance) is created;&lt;/P&gt;&lt;P&gt;- the static constructor: it's triggered only once;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 11:02:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constructor-in-ooabap/m-p/3967025#M947573</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T11:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: constructor in ooabap</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constructor-in-ooabap/m-p/3967026#M947574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Krishnaveni,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Static Constructor:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Static constructors are executed the first time you address a class.  In case you address a static attribute declared in a superclass using the class name of a subclass, only the static constructor of the superclass is executed.  There is only one static constructor. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instance Constructor:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the first method which is called when an object is created. There can be a constructor for every instance of an object created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 11:44:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constructor-in-ooabap/m-p/3967026#M947574</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T11:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: constructor in ooabap</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constructor-in-ooabap/m-p/3967027#M947575</link>
      <description>&lt;P&gt;&lt;STRONG&gt;example :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;CLASS test DEFINITION.&lt;/P&gt;&lt;P&gt; PUBLIC SECTION.&lt;BR /&gt; Data: num TYPE i.&lt;BR /&gt; CLASS-METHODS: class_constructor.&lt;BR /&gt; METHODS: constructor IMPORTING val type i.&lt;BR /&gt;&lt;BR /&gt;endclass.&lt;BR /&gt;&lt;BR /&gt;CLASS test IMPLEMENTATION.&lt;BR /&gt; METHOD CLASS_CONSTRUCTOR.&lt;BR /&gt; WRITE: /'INSIDE STATIC CONSTRUCTOR'.&lt;BR /&gt; ENDMETHOD.&lt;BR /&gt;&lt;BR /&gt; METHOD CONSTRUCTOR.&lt;BR /&gt; num = val.&lt;BR /&gt; WRITE: / 'INSIDE INSTANCE CONSTRUCTOR val: ', num.&lt;BR /&gt; ENDMETHOD.&lt;BR /&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;START-OF-SELECTION.&lt;BR /&gt;&lt;BR /&gt;DATA(obj) = NEW test( val = 10 ).&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 13:08:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constructor-in-ooabap/m-p/3967027#M947575</guid>
      <dc:creator>former_member694068</dc:creator>
      <dc:date>2020-08-26T13:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: constructor in ooabap</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constructor-in-ooabap/m-p/3967028#M947576</link>
      <description>&lt;P&gt;It's a Special method it trigger whenever create a object for the class. &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Instance
Constructor:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;Its
specific to object&lt;/LI&gt;&lt;LI&gt;Whenever
new object is created it get executed&lt;/LI&gt;&lt;LI&gt;In this method name should be &lt;STRONG&gt;CONSTRUCTOR. &lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;It
can contain only importing parameters and exceptions&lt;/LI&gt;&lt;LI&gt;Its
executed only life time of each object.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Static
constructor:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;Its
not specific to any object.&lt;/LI&gt;&lt;LI&gt;Its
Executed in either of following two cases&lt;/LI&gt;&lt;LI&gt;when
we access static components before creating any objects&lt;/LI&gt;&lt;LI&gt;when
we create the first object of the class&lt;/LI&gt;&lt;LI&gt;In
this method name should be &lt;STRONG&gt;CLASS_CONSTRUCTOR.&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;It
can’t contain any parameters and exceptions.&lt;/LI&gt;&lt;LI&gt; its Executed only once in life time of entire
class.&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 26 Aug 2020 13:13:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constructor-in-ooabap/m-p/3967028#M947576</guid>
      <dc:creator>prabhu_04</dc:creator>
      <dc:date>2020-08-26T13:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: constructor in ooabap</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constructor-in-ooabap/m-p/3967029#M947577</link>
      <description>&lt;P&gt;Generally Constructor is a special method which is triggered whenever we create object for the class.&lt;/P&gt;&lt;P&gt;type 1 : instance constructor &lt;/P&gt;&lt;P&gt;&amp;gt; whenever we instantiate the object using the create object statement, instance constructor is triggered.&lt;/P&gt;&lt;P&gt;&amp;gt; Each class has an instance constructor by default.&lt;/P&gt;&lt;P&gt;&amp;gt; instance constructor have only importing parameter.&lt;/P&gt;&lt;P&gt;&amp;gt;instance constructor is executed n no. of time i.e n no. of objects created.&lt;/P&gt;&lt;P&gt;type 2 : static constructor&lt;/P&gt;&lt;P&gt;&amp;gt; also called class constructor.&lt;/P&gt;&lt;P&gt;&amp;gt; whenever the system access the class for the first time, static constructor is triggered.&lt;/P&gt;&lt;P&gt;&amp;gt; no importing parameters and no exceptions&lt;/P&gt;&lt;P&gt;&amp;gt; static constructor can be executed only once i.e when system access the class first time.&lt;/P&gt;&lt;P&gt;EXAMPLE:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;CLASS ABC DEFINITION.&lt;BR /&gt;&lt;BR /&gt; PUBLIC SECTION.&lt;BR /&gt; CLASS-METHODS : CLASS_CONSTRUCTOR. "STATIC CONSTRUCTOR&lt;BR /&gt; METHODS : CONSTRUCTOR. "INSTANCE CONSTRUCTOR&lt;BR /&gt; CLASS-DATA : LV TYPE I.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ENDCLASS.&lt;BR /&gt;&lt;BR /&gt;CLASS ABC IMPLEMENTATION.&lt;BR /&gt;&lt;BR /&gt; METHOD CLASS_CONSTRUCTOR.&lt;BR /&gt; WRITE:/ 'CLASS CONSTRUCTOR'.&lt;BR /&gt; ENDMETHOD.&lt;BR /&gt;&lt;BR /&gt; METHOD CONSTRUCTOR.&lt;BR /&gt; WRITE:/ 'INSTANCE CONSTRUCTOR'.&lt;BR /&gt; ENDMETHOD.&lt;BR /&gt;&lt;BR /&gt;ENDCLASS.&lt;BR /&gt;START-OF-SELECTION.&lt;BR /&gt;ABC=&amp;gt;LV = 100.&lt;BR /&gt;DATA : OBJ TYPE REF TO ABC.&lt;BR /&gt;CREATE OBJECT OBJ.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Varun Shukla&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2020 05:51:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constructor-in-ooabap/m-p/3967029#M947577</guid>
      <dc:creator>former_member702605</dc:creator>
      <dc:date>2020-09-16T05:51:36Z</dc:date>
    </item>
  </channel>
</rss>

