CREATEOBJ

Use

CREATEOBJ ( <parameter> , <command interface> ).

CREATEOBJ ( <parameter> , <command interface> , <target system> ).

This command generates an object of a class and then assigns a reference to the object to the parameter <parameter>. In the log, the reference to the object (the instance number) is a 10 digit number in angle brackets (for example <0000000001>). If the parameter exists it must have one of the following reference types:

·        The class of the object

·        The class from which the class of the object inherits

·        An interface that the class of the object implements

If the parameter does not exist, it can be created during the pattern insert.

The arguments of the constructor of the class are contained in the command interface <command interface>. This command interface is generated when you use the Pattern function to enter the command.

If a target system is specified, the object is created in a session in the target system.

Procedure

       1.      In the parameter list, create a parameter with the reference type that you want to instantiate.

       2.      In the command editor, set the focus where the command is to be entered.

       3.      Choose Pattern.

       4.      In the Group field, choose ABAP Objects.

       5.      In the Command field, choose CREATEOBJ.

       6.      If you want to create a parameter, enter the name of the wanted class in the Class field.

       7.      In the Object Instance Parameter field, enter the parameter name.

       8.      Choose Enter.

       9.      In the Interface field, accept or change the suggested name.

   10.      Choose Enter.