Start of Content Area

Component documentation References  Locate the document in its SAP Library structure

Objects in area instance versions can only be accessed using references.

A requirement for accessing objects in area instances of the shared memory from an ABAP program is that a suitable lock must be set by binding an area handle to the area instance.

The root object that can reference additional objects is used for the initial access to the objects in an area instance version.

References can exist from the area instance version to the program’s objects, and objects of the area instance version can be used in the program only during the time when an area handle for an area instance version is available in a program. During this time, you can work with the references as usual, with the restriction that the type of lock determines whether or not the referenced objects of the area instance version can be changed. If there is a read or change access to the content of an object of the area instance version, although there is no corresponding lock, then a runtime error occurs.

Area instances that are not bound to any area handles are self-contained. If the lock is released using the DETACH_COMMIT method of the area handle after change accesses, no references from an area instance version may refer externally. After the DETACH_COMMIT method, references that refer externally to objects of the area instance version can no longer be used to access the corresponding objects.

Before Release 7.0, only object references were possible within a completed area instance version; from Release 7.0, data references are also possible. Data references can be created using assignments GET REFERENCE or CREATE DATA dref AREA HANDLE. Here there is a restriction that the dynamic types of data references may not have been created dynamically at program runtime. The following cannot currently be used:

·        Data types that were created dynamically with methods of the RTTC and bound data types of anonymous data objects that were not defined until they were created with CREATE DATA.

·        Data types that were created in a temporary subroutine pool that was created with GENERATE SUBROUTINE POOL.

·        For technical reasons, ABAP Dictionary data elements and table types. 

The option of data references within a completed area instance version permits the creation of anonymous data objects as shared objects from Release 7.0.

Note

You can use the static methods GET_HANDLE_BY_OREF, GET_HANDLE_BY_DREF (from Release 7.0) and GET_HANDLE_BY_DATA (from Release 7.0) to obtain a reference to the area handle of an object. The corresponding return value is of type CL_ABAP_MEMORY_AREA, which is why this sort of reference is really only suitable for creating objects.

 

End of Content Area