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 of the Definition tab, 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 following fields:

External Representation Fields

Fields

Description

Field Label

Used as a label for Simple Type Web Dynpro fields.

Column Label

Used as a header for Web Dynpro table columns making use of the Simple Type.

Quick Info

Used for Web Dynpro fields that are typed with the Simple Type. They are displayed whenever the mouse is moved over the field.

Format

The Format property is used to influence the screen-appearance of data and allows you to define rules for data input. You can specify a format template that is used at runtime to check data for correct input and to prepare it for output on screen. This template is effective for the built-in types string, date, time, and timestamp as well as for all numerical built-in types such as integer, float, and decimal. In case of date, time and timestamp all possible format templates are described in the JavaDoc of the java class java.text.DateFormat and  java.text.SimpleDateFormat. The JavaDoc of java.text.DateFormat  describes the locale-independent formats that you can choose to

 define input and output rules. The JavaDoc of java.text.SimpleDateFormat describes how to create templates for special locales.

For numerical built-in types, the JavaDoc of the class java.text.DecimalFormat tells you how to produce format templates for input and

output.

For a SimpleType with built-in type string and numerical string input and output, you can apply the predefined format

ALPHA . This format adds leading zeros when parsing external to internal data and remove them for screen output. To use this format, enter ALPHA in the format field.

External Length

Determines the visible length of a Web Dynpro field that is of a Simple Type. The visible length includes formatting characters (for example,  separator or minus sign).

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.

Caution

This flag is used by SAP delivered types only. Do not set it for non-SAP types or as a modification to SAP types.

Read Only

Determines whether a Web Dynpro field that is of a Simple Type is editable or read-only.

Uppercase

Indicates whether a Web Dynpro field that is of a Simple Type is displayed in upper case or not.

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

 

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