ABAPCREATE_DATA_AREA_HANDLE - CREATE DATA AREA HANDLE
General Material Data ROGBILLS - Synchronize billing plansThis documentation is copyright by SAP AG.
CREATE DATA - AREA HANDLE
Syntax
CREATE DATA dref AREA HANDLE handle ... .
Effect
This statement creates an anonymous data object asshared object in thearea instance version of theshared memory, which is bound to thearea handle referenced by handle.
For handle, an object reference variable must be specified, whose static type is CL_ABAP_MEMORY_AREA or one of its subclasses(area class). When the statement is executed, handle must point to anareahandle and the area handle must be bound to an area instance version with a change lock. To create such a reference, you have the following options:
- Transfer of the return value of the methods ATTACH_FOR_WRITE or ATTACH_FOR_UPDATE of an area class created with SHMA.
- Transfer of the return value of the method GET_HANDLE_BY_OREF of any area class.
- Transfer of 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 currentinternalsession and the CREATE DATA statement functions in the same way as without the AREA HANDLE addition.
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 closedarea instance versions of the shared objects memory is restricted to thosedynamic types that are known when a program is loaded into an internal session.
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:
- All data types that are created in a temporary subroutine pool created with GENERATE SUBROUTINE POOL.
- Data types created dynamically at runtime with methods of the RTTC.
- 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.
- 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 apply in particular to the CREATE DATA statement with the addition AREA HANDLE itself. Exceptions to the restrictions listed under points 2 to 4 are:
- The restrictions do not apply to data type p.
- The restrictions do not apply to data types c, n and x as long as the storage requirements do not exceed 100 bytes.
If a data reference variable that is stored in the shared objects memory references an anonymous dataobject of a dynamic type that is subject to the restrictions, an exception of class CX_SHM_EXTERNAL_TYPE is raised when the DETACH_COMMIT method is executed.
The following can be used without restriction:
- All visible data types of global interfaces and classes.
- Data elements, structures and database tables and table types of the ABAP Dictionary.
- Data types from type groups.
- Bound data types of anonymous data objects created at program runtime to which a static type with a static length was assigned when they were created with CREATE DATA.
- Bound data types of anonymous data objects created at program runtime to which a fully specified dynamic type was assigned when they were created with CREATE DATA.
- All data types that were created statically in the same program with declarative statements. However, you should note that you can no longer access existing area instances once you change the creating program.
The additions REFTO and TABLEOF can be used as long as the specified types fulfill the above requirements. This also appliesto the addition HANDLE, which means the type object must have been created from permitted types with methods of theRTTI.
Notes
- The only shared object that can be addressed from an ABAP program directly after connecting an area instance version, is the instance of thearearoot class. All other objects must be referenced in this instance. In particular, direct accessto anonymous data objects is not permitted. Instead, the instance of the area root class must contain references to these anonymous data objects, which can also be indirect.
- We recommend that you only use global data types with AREA HANDLE. As a temporary replacementfor the direct reference to data elements and table types of the ABAP Dictionary, you can create the relevant types in global interfaces, classes, or even type groups.
Example
See Creating a Data Object as a Shared Object.
Addresses (Business Address Services) BAL Application Log Documentation
This documentation is copyright by SAP AG.
Length: 7434 Date: 20120522 Time: 041552 triton ( 251 ms )






