...
1. In the Class Builder, open the class you want to edit
2. Choose the Types tab page.
3. To create a type, enter the following information:
Option |
Description |
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. If you choose Package, all objects of the same package can access the type. Protected gives access to the subclasses of the class. Public enables access for all classes. |
Typing |
ABAP keyword specifying the reference type. You can choose one of the following: Type, Like or Type Ref To (for class references). |
Associated 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. Save your entries.
5. If you need to specify more details about a data type (for example, field length of character field), choose Direct type entry.
Direct Type Entry
The contents of the class pool appear for the corresponding visibility section.
6. Modify the data type.
TYPES Statement
7. Check the syntax.
8. Save your entries in the editor.
9. Choose Back to return to the Types display.
You have created new data types and, depending on the Visibility level you have specified, 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. For more information, see the ABAP Keyword Documentation.
For more information about data types, classification, visibility, see the data types section of the ABAP User’s Guide.