SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Creating Objects and Values → CREATE DATA →
CREATE DATA - AREA HANDLE
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:
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
Catchable Exceptions
CX_SHM_WRONG_HANDLE
CX_SHM_ALREADY_DETACHED
CX_SHM_OUT_OF_MEMORY