SAP OBJECT SAP Info












ARTICLE ( Version: 0053)

Objects
Objects are instances of classes. All
transient objects exist within the context of an internal session (memory area of an ABAP program). Persistent objects in the database are not available in Release 4.5A. You can create any number of objects (instances) for a class. Each one has a unique identity and its own attributes.

Creating Objects
To create an object, you need a reference
variable that refers to the class of the object. Once you have declared a class reference variable obj for the class class, you can use the CREATE OBJECT obj statement to create an object. The statement creates an instance of the class class, and the reference variable obj contains a reference to the object.

Accessing the Components of Objects
Programs access the visible components of an object using references
reference variables using the following syntax (where obj is a reference variable):
  Accessing an attribute attr: obj->attr
  Calling a method meth: CALL METHOD obj->meth
The static attributes of a class can also be accessed using the class
name:

  Accessing a static attribute attr: class=>attr
  Calling a static method meth: CALL METHOD class=>meth
Within a class, you can use the self-reference ME to access the
components of that class:

  Accessing an internal attribute attr: ME->attr
  Accessing an internal method meth: CALL METHOD ME->meth
The self-reference technique allows objects to pass references to
themselves to other objects. It also allows you to access object attributes in a method, even though they are obscured by local attributes within the method.

Lifetime of Objects
An object remains intact for as long as it is used in a program. In
practice, this means for as long as at least one reference points to it, or while it is registered as an event handler.
Objects are deleted by the automatic memory management (garbage
collection) when no more references to them exist, or when they cease to be registered as an event handler. The identity of the object becomes free, and can be taken up by a new object.

ARTICLE ( Version: 0064)

Objects
Objects are instances of classes. All
transient objects exist within the context of an internal session (memory area of an ABAP program). Persistent objects in the database are not available in ABAP_99A . You can create any number of objects (instances) for a class. Each one has a unique identity and its own attributes.

Creating Objects
To create an object, you need a object
reference variable that can refer to the required class:

  Once you have declared a class reference variable obj for the class class, you can use the CREATE OBJECT obj statement to create an object. The statement creates an instance of the class class, and the reference variable obj contains a reference to the object.

  Once you have declared a class reference variable obj for a superclass of the class class or an interface reference variable obj for an interface which is implemented by the class class , you can use the addition TYPE class of the statement CREATE OBJECT obj to generate an instance of the class class.

Accessing instance components
Programs access the visible components of an object using references in
reference variables. The syntax for this is described under Access to class components.

Lifetime of objects
An object remains intact for as long as it is used in a program. In
practice, this means for as long as at least one reference points to it, or while it is registered as an event handler.
Objects are deleted by the automatic memory management (garbage
collection) when no more references to them exist, or when they cease to be registered as an event handler. The identity of the object becomes free, and can be taken up by a new object.

ARTICLE ( Version: 0067)

Objects
Objects are instances of classes. All
transient objects exist without a hierarchy in the data area of an internal mode. This means that objects can only be accessed within an internal mode. There are no memory areas for cross-transaction objects on the application server. Persistent objects on the database are in preparation but are not yet available. Any number of objects or instances can exist for a class. Each object has a unique identity and its own attributes.

Creating Objects
If you want to create an object, you need an
object reference variable that can point to the desired class.

  Having declared a class reference variable obj for a class class, you can create an object of that class using the CREATE OBJECT obj statement. This statement creates an instance of the class class . The reference variable obj contains a reference to this object.

  Having declared a class reference variable obj for a superclass of the class class or an interface reference variable obj for an interface implemented by the class class, you can use the TYPE class addition of the CREATE OBJECT obj statement to create an instance of the class class .

Access to Instance Components
A program can access the visible instance components of an object only
through references in reference variables . For the syntax, see Accessing Components of Classes.

Lifetime of Objects
An object exists as long as it is used in the program. A program uses
an object as long as at least one reference points to that object or at least one method of the object is registered as an event handler.
As soon as there is no longer a reference to the object and no method
is registered any longer as an event handler, the object can be deleted by automatic storage management (garbage collection). This releases the identity of the object which can then be assigned to a new object.


ARTICLE ( Version: 0083)

Objects
Objects are instances of classes. There can be any number of objects or
instances in a class. Each object has a unique identity and its own attributes.
As standard, objects have the same priority in the
data area of an DS:ABEN.INTERNAL_SESSION_GLOSRY>internal session. This means that objects can only be accessed from within an internal session.
For transaction-independent objects,
shared objects have been introduced for release 6.40, which can be accessed by all programs of an application server at the same time.
In release 6.10, Object Services
were introduced for handling persistent objects in the database. These link the attributes of objects with the content of database tables and can execute object-oriented transactions.

Creating Objects
If you want to create an object, you need an
object reference variable that can point to the desired class.

  Having declared a class reference variable obj for a class class, you can create an object of that class using the statement CREATE OBJECT obj This statement creates an instance of the class class. The reference variable obj contains a reference to this object.

  Having declared a class reference variable obj for a superclass of the class class or an interface reference variable obj for an interface implemented by the class class, you can use the TYPE class addition of the CREATE OBJECT obj statement to create an instance of the class class .

Access to Instance Components
A program can access the visible instance components of an object only
through references in reference variables . For the syntax, see Accessing Components of Classes.

Lifetime of Objects
An object lives as long as the internal session in which it is used. An
object is used so long as at least one reference to it exists or at least one method of the object is registered as an event handler.
As soon as there are no lnoger any references to the object, and none of
its methods are registered any longer as event handlers, the object can be deleted by automatic storage management (garbage collection). This releases the identity of the object. This can then be assigned to a new object.

ARTICLE ( Version: 0088)

Objects
Objects are instances of classes. There can be any number of objects or
instances in a class. Each object has a unique identity and its own attributes.
As standard, objects have the same priority in the
data area of an DS:ABEN.INTERNAL_SESSION_GLOSRY>internal session. This means that objects can only be accessed from within an internal session.
For transaction-independent objects,
shared objects are available, which can be accessed by all programs of an application server at the same time.
Object Services are available
for handling persistent objects in the database. These link the attributes of objects with the content of database tables and can execute object-oriented transactions.

Creating Objects
If you want to create an object, you need an object
reference variable that can point to the desired class.

  Having declared a class reference variable obj for a class class, you can create an object of that class using the statement CREATE OBJECT obj This statement creates an instance of the class class. The reference variable obj contains a reference to this object.

  Having declared a class reference variable obj for a superclass of the class class or an interface reference variable obj for an interface implemented by the class class, you can use the TYPE class addition of the CREATE OBJECT obj statement to create an instance of the class class .

Access to Instance Components
A program can access the visible instance components of an object only
through references in reference variables. For the syntax, see Accessing Components of Classes.

Lifetime of Objects
An object lives as long as the internal session in which it is used. An
object is used so long as at least one reference to it exists or at least one method of the object is registered as an event handler.
As soon as there are no lnoger any references to the object, and none of
its methods are registered any longer as event handlers, the object can be deleted by automatic storage management (Garbage Collector ). This releases the identity of the object. This can then be assigned to a new object.

ARTICLE ( Version: 0090)

Objects
Objects are instances of classes. There can be any number of objects or
instances in a class. Each object has a unique identity and its own attributes.
As standard, all objects have the same priority in the
data area of an internal session. This means that objects can only be accessed from within an internal session.
For transaction-independent objects,
shared objects are available, which can be accessed by all programs of an application server at the same time.
Object Services are available
for handling persistent objects in the database. These link the attributes of objects with the content of database tables and can execute object-oriented transactions.

Creating Objects
If you want to create an object, you need an object
reference variable that can point to the required class:

  Having declared a class reference variable obj for a class class, you can create an object of that class using the statement CREATE OBJECT obj. This statement creates an instance of the class class and the reference variable obj contains a reference to this object.

  Having declared a class reference variable obj for a superclass of the class class or an interface reference variable obj for an interface implemented by the class class, you can use the TYPE class addition of the CREATE OBJECT obj statement to create an instance of the class class .

Access to Instance Components
A program can access the visible instance components of an object only
through references in reference variables. For the syntax, see Accessing Components of Classes.

Lifetime of Objects
An object is alive as long as the internal session in which it is used.
An object is used for as long as at least one reference to it exists or at least one method of the object is registered as an event handler.
As soon as an object has no more references and none of its methods is
registered as an event handler, it can be deleted by the Garbage Collector). This releases the identity of the object to be taken by a new object.

Note
Alongside these regular references, weak
references represented by objects exist that do not keep an object alive.

ARTICLE ( Version: 0094)

Objects
Objects are instances of classes. There can be any number of objects or
instances in a class. Each object has a unique identity and its own attributes.
As standard, all objects have the same priority in the
data area of an internal session. This means that objects can only be accessed from within an internal session.
For transaction-independent objects,
shared objects are available, which can be accessed by all programs of an application server at the same time.
Object Services are available
for handling persistent objects in the database. These link the attributes of objects with the content of database tables and can execute object-oriented transactions.

Creating Objects
If you want to create an object, you need an object
reference variable that can point to the required class:

  Having declared a class reference variable obj for a class class, you can create an object of that class using the statement CREATE OBJECT obj. This statement creates an instance of the class class and the reference variable obj contains a reference to this object.

  Having declared a class reference variable obj for a superclass of the class class or an interface reference variable obj for an interface implemented by the class class, you can use the TYPE class addition of the CREATE OBJECT obj statement to create an instance of the class class .

Access to Instance Components
A program can access the visible instance components of an object only
through references in reference variables. For the syntax, see Accessing Components of Classes.

Lifetime of Objects
An object is kept alive for as long as it is used in the internal
session (Heap). The system will continue use the object provided that at least one Heapreference points to the object, an instance attribute or part of the instance attribute or provided that at least one method of the object is registered as an event handler. Field symbols to which an instance attribute or part of an instance attribute is assigned still work in the same way as data references.
As soon as an object has no more references and none of its methods is
registered as an event handler, it can be deleted by the Garbage Collector). This releases the identity of the object to be taken by a new object.

Note
Alongside these regular references, weak
references represented by objects exist that do not keep an object alive.

ARTICLE ( Version: 0095)

Objects
Objects are instances of classes. There can be any number of objects or
instances in a class. Each object has a unique identity and its own attributes.
As standard, all objects have the same priority in the
data area of an internal session. This means that objects can only be accessed from within an internal session.
For transaction-independent objects,
shared objects are available, which can be accessed by all programs of an application server at the same time.
Object Services are available
for handling persistent objects in the database. These link the attributes of objects with the content of database tables and can execute object-oriented transactions.

Creating Objects
Before an object can be created, an object reference
variable is required that can point to the required class:

  Once a class reference variable obj is declared for a class class, an object of that class can be created using the statement CREATE OBJECT obj. This statement creates an instance of the class class and the reference variable obj contains a reference to this object.

  Once a class reference variable obj is declared for a superclass of the class class or an interface reference variable obj for an interface implemented by the class class, the TYPE class addition of the CREATE OBJECT obj statement can be used to create an instance of the class class .
The instance operator NEW
enables objects to be created in general expression positions.

Access to Instance Components
A program can access the visible instance components of an object only
through references in reference variables. For the syntax, see Accessing Components of Classes.

Lifetime of Objects
An object is kept alive for as long as it is used in the internal
session (Heap). The system will continue use the object provided that at least one Heapreference points to the object, an instance attribute or part of the instance attribute or provided that at least one method of the object is registered as an event handler. Field symbols to which an instance attribute or part of an instance attribute is assigned still work in the same way as data references.
As soon as an object has no more references and none of its methods is
registered as an event handler, it can be deleted by the Garbage Collector). This releases the identity of the object to be taken by a new object.

Note
Alongside these regular references, weak
references represented by objects exist that do not keep an object alive.
Message text extract from SAP system. Copyright SAP SE.


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!