Type of Fields

Type Description
t Text with specified maximum length.
b Text Block with specified maximum line length and specified line count.
n Numeric with specified digits. If decimal positions after the decimal point need to be specified, the total number of digits and the number of decimals are specified. (i.e. 5,2 means a number with up to 3 + 2 digits like 123.45.)
y Yes / No switch. 'No' is represented by a blank or an empty value. Any non space value represents 'Yes'. Internally these fields are always stored as 1 character text fields. Normally the values used are ' ' (=No) and 'Y' (=Yes).
c Code in internal representation. The code length is specified. The table used to generate the external representation is defined separately and might depend on the context of the usage. Internally these fields are always stored as character text fields of the specified length.
d Date. The specified length refers to the external length. Internally Dates are always stored with 8 digits.
k Key Value of a different table. Internally these fields are always stored as character text fields of the specified length.
h Time specified as numeric values. The value is specified in hours. Minutes and seconds are specified as decimals. The technical format is 'numeric'. Usually the format used is 6,4, where 2 digits specify the hours and 4 digits specify the minutes and seconds. The representation of the time 14:47:23 would be a number holding 14.4723.

Codes

Inside the database codes are used to identify certain status information. To decode these codes a special decoding table and decoding functions are available. These functions use up to four arguments / fields:

Thus depending on the context different external longnames could be used. Depending on the target language, different translated longnames could be supplied automatically.

On panels internal codes should normally be displayed in external long notation to give a clear understanding for the user. This could be done via Combo-Boxes.

The usage of codes should be restricted to tables which are supposed to be unchanged during normal processing. These tables should be changed during initial setup or later during configuration or application maintenance.

The codetable itself may only hold a text. No other information might be stored in the codetable or might be retrieved out of the stored text. If additional information is necessary, these additional fields should be stored in a separate table.

To maintain the different codetables, the tool 'SYSTBL' could be used. This tool maintains the database tables 'STB' and 'STH', which are used to store the codetable information. This tool supplies a codetable export and import facility for easy transport of codetable as 'Code Table Exchange' (File extension = CTE) files between systems. Another implementation to maintain a codetable would be the usage of the module CODMOD for maintaining the associated codetable.

Key Values

To identify records in different tables it is possible to use a unique keyfield instead to use an INR. In this case the linking record might hold the keyfield (usually the field COD) identifying the record to which was linked.