!--a11y-->
Creating Data Types 
This procedure describes how you create a simple data type in the Java Dictionary. You can define the new data type based on a built-in type, or derive it from another simple type.
...
1. In the Dictionary perspective, create a new DC component. For more information, see Development Process.
2. In the Dictionary Explorer view, position the cursor on Simple Types, and choose Create Simple Type in the context menu.
3. Enter the name of the package and the name of the simple type.
4. In the Built-in Type field, enter a built-in type, or choose an already existing simple type in the Base Type field. If the new data type refers to an existing simple type, this is a type derivation. For more information, see Type Derivation below.

5. Enter the required data into the fields under Length Constraints and Value Constraints. Depending on the data type, different fields are ready for input.
The input fields under Value Constraints mean the following:
Field Name |
Value Range |
Minimum Inclusive |
>= |
Maximum Inclusive |
<= |
Minimum Exclusive |
> |
Maximum Exclusive |
< |
6. Choose the Enumeration tab if you only wish to allow certain values for the simple type. You can have the input help for the field displayed in Web Dynpro.
Choose New to add a new value.

Simple types refer to a basis type (for example, string, double). An enumeration defined in the Java Dictionary has the effect that a list of the allowed values is stored. The input check for a field on a screen is based on this list. If you choose the option Generate a class representation for the simple type for the String basis type, there will be a class generated that is available at runtime. The name of the class corresponds to the name of the simple type. The first letter is written in uppercase. An object of this class represents exactly one value of the enumeration. If objects of this class are used – for example, in interfaces - type security and subsequent use of the enumeration values can be ensured.
7. Choose the tab Representation. Enter the field name, column heading, and quick info here. These texts can be displayed when the type is used in Web Dynpro.
The external representation of a simple type refers to the properties that define how the data in a field of this type is presented to the user. The options for external representation have the following meaning:
Option |
Meaning |
Format |
Use the following formats for this field: DATE yyyy-MM-dd TIME H:mm:ss.SSS TIMESTAMP yyyy-MM-dd-TH:mm For more information about the use of formats, see the API documentation for the classes java.text.DecimalFormat and java.text.SimpleDateFormat at java.sun.com. |
External Length |
The length also includes editing characters, such as a decimal point or thousand point. |
Translatable |
This property is interpreted if the relevant simple type is used in configuration models in Web Dynpro projects. If the simple type of an attribute in a configuration model is marked as Translatable, the values of this attribute are persisted language-dependent – that is, a different value for each language. The language in which the simple type is generated depends on the language support that you choose when creating the Java Dictionary project itself. |
ReadOnly |
A field of a read-only type displays the set values, but you cannot edit these values. |

The external representation options depend on the built-in type that you use. Some of the options may not be applicable to all built-in types.
8. Choose the tab Database. For each simple type, you can establish whether the type in the database is to be filled with an initial value (not null). For more information, see Initial Values.
9. Save your data.
To derive the simple type from a type that already exists, proceed as follows:
...
1. Enter the simple type in the Base Type field.
Choose the Browse pushbutton. When you manually enter the Base Type in the field, enter the complete specified type in the form Package name Type name.
Type derivation means that the simple type inherits the properties of the base type (same as inheritance in classes).
2. Enter a short text in the Description field.
All the other fields of the inherited properties are not ready for input. The properties of the base type are adopted into the runtime object of the simple type when the latter is generated.
You can interrupt the type derivation for individual properties and overwrite a property with a new value. To do this, choose the Overwrite Base Type pushbutton beside the corresponding field and change the value. Next time you generate the simple type, the new value of this property is adopted into the runtime object.
To restore the type derivation for this property, choose the Reset to Base Type pushbutton.
3. Choose the Enumeration tab if you only wish to allow certain values for the simple type. The derived Simple Type inherits its input help from the Base Type. You can limit the value set of the derived Simple Type by deleting the enumeration values. In this way, you interrupt the enumeration inheritance. However, if you delete all the enumeration values, the enumeration inheritance (and thus also the maximum value set allowed) will be restored.
See also:
