Ansicht
Dokumentation

ABAPCREATE_OBJECT_AREA_HANDLE - CREATE OBJECT AREA HANDLE

ABAPCREATE_OBJECT_AREA_HANDLE - CREATE OBJECT AREA HANDLE

ROGBILLS - Synchronize billing plans   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.
SAP E-Book

CREATE OBJECT, AREA HANDLE

Short Reference



CREATE OBJECT oref AREA HANDLE handle ...

Effect

This statement creates an object as a shared object in the area instance version of the shared memory, to which the area handle referenced by handle is bound. The implicitly or explicitly specified class must be defined as a shared-memory-enabled class using the addition SHARED MEMORY ENABLED of the statement CLASS.

For handle, an object reference variable whose static type is CL_ABAP_MEMORY_AREA or one of its subclasses (area class) must be specified. When the statement is executed, handle must point to an area handle and the area handle must be bound to 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 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 the statement CREATE OBJECT works in the same way as without the addition AREA HANDLE.

Notes

  • 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 must be referenced in this instance.
  • The static attributes of a shared object are not created in the shared memory, but when the shared-memory-enabled class is loaded into the internal session of a program, as for every class. This means that they can exist multiple times and independently of one another in different programs.

Example

Creation of a shared object in an area instance version of the area CL_DEMO_AREA.

Creating an Instance of a Class as a Shared Object

Exceptions

Catchable Exceptions

CX_SHM_WRONG_HANDLE

  • Cause: The area handle does not hold any change locks.

CX_SHM_ALREADY_DETACHED

  • Cause: The area handle is not bound to an area instance version.

CX_SHM_OUT_OF_MEMORY

  • Cause: There is not enough memory.

CX_SHM_OBJECT_NOT_SERIALIZABLE

  • Cause: In an area instance displaceable using backup and recovery, an attempt was made to create an object that cannot be serialized.






BAL Application Log Documentation   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
This documentation is copyright by SAP AG.

Length: 5037 Date: 20240329 Time: 145707     sap01-206 ( 63 ms )