<?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: create object in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-object/m-p/1188747#M127930</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The CREATE OBJECT statement can also refer to the creation of an OLE object when working with Object Link Enablement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0003.



include ole2incl.

data: e_appl  type ole2_object.


* Start the application
create object e_appl 'EXCEL.APPLICATION'.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Feb 2006 14:08:30 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2006-02-28T14:08:30Z</dc:date>
    <item>
      <title>create object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-object/m-p/1188743#M127926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what is creat object XXXXX&lt;/P&gt;&lt;P&gt;where i can see it &lt;/P&gt;&lt;P&gt;what is the target?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2006 13:43:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-object/m-p/1188743#M127926</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-28T13:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: create object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-object/m-p/1188744#M127927</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;create object, will create the object reference to the class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Double click on the object name, you will show something like that : obj_name type ref to cl...    where cl is the class name that the object point to.&lt;/P&gt;&lt;P&gt;So go in SE24 with this class name and look the method CONSTRUCTOR. You will show the parameter, the code of the "create object"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgd&lt;/P&gt;&lt;P&gt;Frédéric&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2006 13:46:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-object/m-p/1188744#M127927</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2006-02-28T13:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: create object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-object/m-p/1188745#M127928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi liat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create object is used in OO abap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: abc type ref to cl_gui_alv_grid. "reference&lt;/P&gt;&lt;P&gt;create object abc.  "this will create the object of cl_gui_alv_grid class.&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;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2006 13:48:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-object/m-p/1188745#M127928</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-28T13:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: create object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-object/m-p/1188746#M127929</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;This is from F1 on statement "Create"...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE OBJECT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax Forms &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining a Class Implicitly &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. CREATE OBJECT oref [area_handle] [parameter_list]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining a Class Explicitly &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. CREATE OBJECT oref [area_handle] &lt;/P&gt;&lt;P&gt;                TYPE {class|(name)} [parameter_list]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;The CREATE OBJECT statement creates an instance of a class or object and assigns the object reference to the reference variable oref. Directly after the object has been created, the instance constructor of the class is executed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By default, the object is created in the internal session of the current program and remains there as long as it is needed. When it is no longer referenced by any reference variable, it is deleted from the garbage collector . You can use the area_handle addition to create the object as a shared object. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reference variable oref must be declared as an object reference variable. Instance components of an object created using CREATE OBJECT can only be accessed using object reference variables (see Data Objects in Operand Positions). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the TYPE addition to specify the class of the created object. The static type of the object reference variable must be more general than or identical to the class of the created object, in accordance with the rules for Assignments Between Object Reference Variables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the parameter_list addition you must fill the non-optional input parameters of the first explicitly implemented instance constructor, which is on the path of the inheritance tree from the instantiated class to the root class object. You can also use the parameter_list addition to assign return values to the non-class-based exceptions of the instance constructor. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If an exception that can be handled occurs in the runtime environment during the creation of the object, it is not created and the object reference variable oref is initialized. If, after the object has been created, an exception that can be handled occurs in the instance constructor of the class or a message is sent using MESSAGE RAISING, the created object is deleted and the object reference oref is initialized. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Return Value&lt;/P&gt;&lt;P&gt;If the CREATE OBJECT statement is executed successfully, sy-subrc is set to 0. Values other than 0 are set by specifying EXCEPTIONS in parameter_spec when non-class-based exceptions of the instance constructor are handled. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;You can only create an instance of a class where permitted by the AB&amp;gt;CREATE addition to the CLASS DEFINITION statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exceptions &lt;/P&gt;&lt;P&gt;Catchable Exceptions &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CX_SY_CREATE_OBJECT_ERROR &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cause: You tried to instantiate an abstract class &lt;/P&gt;&lt;P&gt;Runtime Error: CREATE_OBJECT_CLASS_ABSTRACT (catchable) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cause: The class specified in the TYPE addition does not exist &lt;/P&gt;&lt;P&gt;Runtime Error: CREATE_OBJECT_CLASS_NOT_FOUND (catchable) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cause: You tried to instantiate a private class externally &lt;/P&gt;&lt;P&gt;Runtime Error: CREATE_OBJECT_CREATE_PRIVATE (catchable) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cause: You tried to instantiate a protected class externally &lt;/P&gt;&lt;P&gt;Runtime Error: CREATE_OBJECT_CREATE_PROTECTED (catchable) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Non-Catchable Exceptions &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cause: You must specify a reference as the target variable &lt;/P&gt;&lt;P&gt;Runtime Error: CREATE_OBJECT_NO_REFTYPE: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Renjith&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2006 13:49:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-object/m-p/1188746#M127929</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-28T13:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: create object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-object/m-p/1188747#M127930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The CREATE OBJECT statement can also refer to the creation of an OLE object when working with Object Link Enablement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0003.



include ole2incl.

data: e_appl  type ole2_object.


* Start the application
create object e_appl 'EXCEL.APPLICATION'.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2006 14:08:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-object/m-p/1188747#M127930</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-02-28T14:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: create object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-object/m-p/1188748#M127931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Liat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE OBJECT XXX&lt;/P&gt;&lt;P&gt;is the syntax for creating a reference(pointer) to an existing class, which is either a global class(which can be defined using SE24 or Class Builder) or a local class (which is defined and implemented in ABAP program itself).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are not new to Object Oriented Programming, then I must say that execution of this statement causes the constructor of the class to be executed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the above statement XXX is the object which is defined as&lt;/P&gt;&lt;P&gt;DATA: XXX type ref to YYY,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where YYY is the name of the class, so that XXX becomes the pointer of the class. After CREATE OBJECT statement is executed , we can access the functions of the class using the syntax&lt;/P&gt;&lt;P&gt;CALL FUNCTION XXX-&amp;gt;function_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help you in exploring more regarding OOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Sylendra.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2006 14:12:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-object/m-p/1188748#M127931</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-28T14:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: create object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-object/m-p/1188749#M127932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Liat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A small correction.. The method of the class can be called using the syntax&lt;/P&gt;&lt;P&gt;CALL METHOD XXX-&amp;gt;function_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this has helped you.&lt;/P&gt;&lt;P&gt;If so, please award points by clicking on the left of reply.&lt;/P&gt;&lt;P&gt;If you have any doubts on OOP, you can contact me .&lt;/P&gt;&lt;P&gt;My mail id is sylendra.prasad@wipro.com&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Sylendra.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2006 14:21:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-object/m-p/1188749#M127932</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-28T14:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: create object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-object/m-p/1188750#M127933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sylendra:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;XXX is not a pointer to a class but to object which is an instance of class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Objects do not have functions but methods and you  can call them with CALL METHOD&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2006 14:24:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-object/m-p/1188750#M127933</guid>
      <dc:creator>former_member182670</dc:creator>
      <dc:date>2006-02-28T14:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: create object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-object/m-p/1188751#M127934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tomasz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: XXX type ref to YYY.&lt;/P&gt;&lt;P&gt;CREATE OBJECT XXX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here XXX is the name of the object. This second statement creates an instance XXX of the class YYY,so that by using the reference symbol '-&amp;gt;' XXX can access the methods of YYY.&lt;/P&gt;&lt;P&gt;Sorry for mentioning FUNCTIONS instead of METHODS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sylendra.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2006 14:44:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-object/m-p/1188751#M127934</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-28T14:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: create object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-object/m-p/1188752#M127935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My task is to display 2 radiobutton on the same screen as the alv grid display.on selection of the 1 radiobutton the grid need to display one internal table.. and on selection of 2nd radiobutton the grid sud display second internal table..&lt;/P&gt;&lt;P&gt;     please explain wid some example...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2007 04:45:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-object/m-p/1188752#M127935</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-04T04:45:24Z</dc:date>
    </item>
  </channel>
</rss>

