CREATE OBJECT - AREA HANDLE
CREATE OBJECT oref AREA HANDLE handle ...
This statement creates an object as a shared object in the
area instance version of the
shared memory, which is bound to the
area handle referenced by
handle. The implicitly or explicitly specified class must be defined as a
using the addition SHARED
MEMORY ENABLED of the statement
handle expects an object reference variable whose static type is CL_ABAP_MEMORY_AREA or one of its subclasses
(area class). When the statement is executed,
handle must point to an
area handle and the area
handle must be associated with an area instance version with a change lock. A reference like this can be created in one of the following ways:
- By inheriting the return value of the methods ATTACH_FOR_WRITE or ATTACH_FOR_UPDATE of an area class created using transaction SHMA.
- By inheriting the return value of the method GET_HANDLE_BY_... of any area class.
By inheriting the return value of the method GET_IMODE_HANDLE of the predefined class CL_IMODE_AREA.
The latter is a reference to an area handle for the current
internal session and
CREATE OBJECT operates as if the addition
AREA HANDLE were not specified.
- The only shared object that can be addressed from an ABAP program directly after a binding is made to an area instance version is the instance of the area root class. All other objects have to be referenced in this instance.
The static attributes of a shared object are not created in the shared memory. Instead, they are created
when the shared-memory-enabled class is loaded to the internal session of a program, as for every class. They can thus occur more than once and independently of one another in different programs.
Creation of a shared object in an area instance version of area CL_DEMO_AREA.
CLASS cls DEFINITION SHARED MEMORY ENABLED. ... ENDCLASS. DATA: root TYPE REF TO cl_demo_root, handle TYPE REF TO cl_demo_area. ... handle = cl_demo_area=>attach_for_write( ). CREATE OBJECT root AREA HANDLE handle. handle->set_root( root ). CREATE OBJECT root->oref AREA HANDLE handle TYPE cls. ...
Cause: The area handle does not hold any change locks.
Cause: The area handle is not bound to an area instance version.
Cause: There is not enough memory.
Cause: In an area instance displaceable using backup and recovery, an attempt was made to create an object that cannot be serialized.