Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Creating Objects →  CREATE OBJECT 


Short Reference

Other versions: 7.31 | 7.40 | 7.54


CREATE OBJECT oref AREA HANDLE handle ... . 


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 associated. The implicitly or explicitly specified class must be defined as a shared memory enabled class using the SHARED MEMORY ENABLED addition of the CLASS statement.

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

  • Copy the return value of the methods ATTACH_FOR_WRITE or ATTACH_FOR_UPDATE of an area class created using transaction SHMA.
  • Copy the return value of the GET_HANDLE_BY_OREF method of any area class.
  • Copy the return value of the GET_IMODE_HANDLE method of the predefined class CL_IMODE_AREA.

The latter is a reference to the area handle for the current internal session and the CREATE OBJECT statement has the effect it does without the AREA HANDLE addition.


  • The only shared object that can be addressed directly from an ABAP program after a connection to an area instance version is the instance of the area root class. All other objects have to be referenced in this instance.
  • Like for every class, the static attributes of a shared object are created when you load the shared memory-enabled class in internal session of a program, and are not created in shared memory. They can thus occur more than once and independently of one another in different programs.


See Creating a Class Instance as a Shared Object


Creating a Class Instance as a Shared Object