Show TOC Start of Content Area

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

Prerequisites

You have created a Dictionary project. For more information, see Development Process.

Procedure

...

       1.      In the Dictionary Explorer view, select Simple Types and choose Create Simple Type from the context menu. The New Simple Type window opens.

       2.      Enter a name for the simple type.

       3.      Enter a name or browse for a package.

       4.      Choose Finish. The simple type opens.

       5.      In the Built-in Type field, enter a built-in type, or choose an 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.

                            a.      Fill the Length Constraints and Value Constraints fields. Depending on the data type, different fields are available for input.

Value Constraints input fields

Field Name

Value Range

Minimum Inclusive

>=

Maximum Inclusive

<=

Minimum Exclusive

>

Maximum Exclusive

<

 

       6.      To specify a list of allowed values for the simple type, choose the Enumeration tab.

      To add a new value, choose New.

Note

To generate a class available at runtime, choose Generate a class representation of the enumeration. 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. Using objects of this class ensures type security and subsequent use of the enumeration values.

       7.      Choose Representation.

      Complete the Field Label, Column Label, and Quick Info fields. These texts are displayed when the type is used in Web Dynpro.

      To specify how the data in a field of the simple type is presented to the user, complete the fields under External Representation.

External Representation Fields

Fields

Description

Format

The Format field facilitates external representation of data types, that is, formats data for output. It has effect on Built-In Types such as string, date, time and timestamp, and numerical Built-In Types.

External Length

Accepts non-negative integers.

Translatable

The Translatable property is applicable in configuration models in Web Dynpro projects.

If the simple type of an attribute in a configuration model is marked as Translatable, the attribute values are language-dependent, that is, a different value is stored 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

Marks the fields of the simple type read-only, that is, data in the field is displayed but is non-editable.

Note

The external representation options depend on the built-in type that you use. Some  options may not be applicable to all built-in types.

       8.      Choose Database.

To specify if the type in the database should always have an initial value, choose Not Null. For more information, see Initial Values.

       9.      To save your data, choose File Save all metadata.

 

Type Derivation

Type derivation means that the simple type inherits the properties of the base type.

...

       1.      To derive a simple type from a type that already exists, choose the Definition tab.

       2.      Choose Browse and select the simple type you wish to derive from in the Simple Type Selection dialog.

Note

You can also enter the type manually. When you manually enter the Base Type in the field, you must enter the fully qualified name of the type.

       3.      Enter a short text in the Description field.

All other fields of the inherited properties are not editable. The properties of the base type are adopted into the runtime object of the simple type when the latter is generated.

You can override type derivation for individual properties. To override a property with a new value, choose Overwrite Base Type next to 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 Reset to Base Type.

       4.      To allow only certain values for the simple type, choose Enumeration. 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) is restored.

 

See also:

Open SQL Data Types

End of Content Area