Entering content frame

Procedure documentation Creating Types Locate the document in its SAP Library structure

Prerequisites

For up to date information about data types, classification, visibility, refer to the Structure linkdata types section of the ABAP User’s Guide.

Procedure

You create data types as follows:

...

       1.      Start the Class Editor in change mode.

       2.      Choose Types.

       3.      To create a type, enter the following information:

- Type
A unique name to identify the type.

- Visibility
Define the visibility of the data types. If you make the type private, it can only be accessed from within the class itself. Protected gives access to the class’s subclasses. Public enables access for all classes.

- Modeled only
If you have selected this option, the system does not enter the interface in the class pool. You cannot access the components at runtime.

– Typing Kind
ABAP keyword to specify the reference type. You can choose one of the following:  Type,  Like  or  Type Ref To (for class references).

- Reference type
You can use any elementary ABAP type (including generic types) or object type (classes and interfaces).

- Description
Short description of the data type.

       4.      Repeat steps 1-3 for any further types.

       5.      Save your entries.

       6.      If you need to qualify a data type further (for example, to specify the field length of a character field), choose Direct type entry. Note that this only makes sense if you have not selected Only modeled.

This graphic is explained in the accompanying text

The contents of the class pool appear for the corresponding visibility section.

       7.      Modify the data type.

This graphic is explained in the accompanying text

       8.      Check the syntax.

       9.      Save your entries in the editor.

   10.      Choose Back to return to the Types display.

Result

You have created new data types and (depending on the Visibility level you specified in step 3) you can refer to these data types in the subclasses of the respective classes, or even in all classes. You can define private, protected and public attributes and interface parameters using the TYPE statement. (See also documentation about ABAP keywords.)

 

 

Leaving content frame