‎2008 Aug 05 8:02 AM
Hi guys,
What is the purpose or how does CREATE OBJECT works?
Thanks a lot!
‎2008 Aug 05 8:09 AM
hi
let take an example
DATA r_vehicle1 TYPE REF TO lcl_vehicle
lcl_vehicle is used to define
a reference variable, which is thereby typed as a pointer to objects of type
lcl_vehicle. The null reference is the technical initial value of a reference variable. ( r_vehicle1 ).
now
when i do this
create object r_vehicle1
The statement CREATE OBJECT creates an object in the memory. Its attribute values are then either initial or assigned according to the VALUE specification.
Cheers
Snehi
‎2008 Aug 05 8:04 AM
Hi,
Create Object is used to create the Instance of the Class i.e Object of the Class.
Check these links-
http://www.slideshare.net/srinatha/oo-abap-sap/
Regards,
Sujit
‎2008 Aug 05 8:04 AM
Hi,
actualy in OOABAP , the objet is created in two steps.
Step1 : in statement
DATA (object_name) type ref to (class name). , we create instance of a class i.e. a null object pointer. To be more specific , a pointer of class type , but not assigned to the class.
Step 2:
CREATE OBJECT (objectname)
Here we create the link of the object to the class
regards,
anirban
‎2008 Aug 05 8:07 AM
hi,
We write CREATE OBJECT inside START-OF-SELECTION Event.
CREATE OBJECT is used to assign the Memory to the Ref. VAriable. It Creates the Actual Object.
Regards
Sumit Agarwal
‎2008 Aug 05 8:09 AM
hi
let take an example
DATA r_vehicle1 TYPE REF TO lcl_vehicle
lcl_vehicle is used to define
a reference variable, which is thereby typed as a pointer to objects of type
lcl_vehicle. The null reference is the technical initial value of a reference variable. ( r_vehicle1 ).
now
when i do this
create object r_vehicle1
The statement CREATE OBJECT creates an object in the memory. Its attribute values are then either initial or assigned according to the VALUE specification.
Cheers
Snehi
‎2008 Aug 05 8:09 AM
Hi,
CREATE OBJECT is used in ABAP OBJECTS to create a runtime object(instance of your class)
This statement creates an object in the memory.
Regards
Abhijeet
‎2008 Aug 05 8:10 AM
Hi
The statement CREATE OBJECT creates an instance of a class.
The methods (Instance Constructor or Static Constructor ) and events will be triggered implicitly when an object is created.
Hope it helps.
Murthy
‎2008 Aug 05 8:17 AM
CREATE OBJECT
Create object is used to Create the Object, and set the Default value to Attributes or initialize the attributes.
When you use Create Object , the Instance Constructor will be called internally (if there is a constructor available in the class ).