ABAP Keyword Documentation →  ABAP − Reference →  Creating Objects and Values →  CREATE DATA → 

CREATE DATA - AREA HANDLE

Short Reference

Syntax

CREATE DATA dref AREA HANDLE handle ... .

Effect

This statement creates an anonymous data object as a shared object in the area instance version of the shared memory, which is bound to the area handle referenced by handle.

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 refer to an area handle and the area handle must be associated to an area instance version with a change lock. To create such a reference, you can do either of the following:

The latter is a reference to an area handle for the current internal mode and the statement CREATE DATA acts like without the addition AREA HANDLE.

Restrictions

The creation of anonymous data objects as shared objects is subject to the following restrictions for data references in the shared objects memory: The storage of data references in closed area instance versions of the shared objects memory is restricted to such dynamic types that are known when loading a program into an internal mode.

Therefore, the following data types cannot be used to create anonymous data objects in the shared object memory, if these are to be preserved in a closed area instance version:

  1. All data types that are created in a temporary subroutine pool created with GENERATE SUBROUTINE POOL.
  2. Data types created dynamically at runtime with methods of the RTTC.
  3. Bound data types of anonymous data objects that were created at program runtime and to which a dynamic length was assigned when they were created with CREATE DATA.
  4. Bound data types of anonymous data objects that were created at program runtime and to which a dynamic type requiring length definition was assigned when the data objects were created with CREATE DATA.

Points 3 and 4 include the statement CREATE DATA with the addition AREA HANDLE itself. Exceptions to the restrictions listed under points 2 to 4 are:

If a data reference variable that is stored in the shared objects memory refers to an anonymous data object of a dynamic type that is subject to the restrictions, the exception of the class CX_SHM_EXTERNAL_TYPE is raised when the DETACH_COMMIT method is executed.

The following can be used without restriction:

The additions REF TO and TABLE OF can be used until the specified types fulfill above requirements. This also applies for the addition HANDLE, that means the type description object must have been created with methods of the RTTI from allowed types.

Notes

Example

See Creating a Data Object as a Shared Object

Exceptions

Catchable Exceptions

CX_SHM_WRONG_HANDLE

CX_SHM_ALREADY_DETACHED

CX_SHM_OUT_OF_MEMORY




Continue
Creating a Data Object as a Shared Object