Show TOC Entering content frame

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, position the cursor on 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 Enumeration.

·        To add a new value, choose New.

Note

To generate a class available at runtime, choose Generate a class representation for the simple type. 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.

·        Fill 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, fill the fields under External Representation.

External Representation Fields

Fields

Description

Format

Accepts time and date data in the following formats:

·        DATE                  yyyy-MM-dd

·        TIME                   H:mm:ss.SSS

·        TIMESTAMP        yyyy-MM-dd-TH:mm

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 noneditable.

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, check Not Null. For more information, see Initial Values.

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

Type Derivation

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. 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.

       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. To overwrite 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 will be 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:

Open SQL Data Types

Leaving content frame