Skip to content

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

CREATE OBJECT oref

Short Reference

Other versions: 7.31 | 7.40 | 7.54

Syntax


CREATE OBJECT oref [area_handle] [parameter_list]. 

Effect

If the addition TYPE is not specified, the object reference variable oref must be a class reference variable. An instance of the class is created that is the static type of the object reference variable. The static type of the class reference variable cannot be an abstract class, and in particular must not be the root class object.


Example

Creates an instance of a class c1 using an implicit reference to the static type of the reference variables.

CLASS c1 DEFINITION. 
  ... 
ENDCLASS. 

... 

DATA oref TYPE REF TO c1. 

... 

CREATE OBJECT oref.