2 Set Up User Defined Data

This chapter contains these topics:

When you set up user defined data, you can:

  • Choose which fields display on various screens.

  • Control how the system verifies field values by attaching override data items.

  • Choose which user defined fields are required fields in the transaction tables.

  • Set up default values that the system retrieves for the transaction tables.

2.1 Setting Up User Data Field Controls

The User Data Field Control program (P40060) allows you greater control over how the system processes the fields in your user defined tables. You use this program to setup customer, supplier, and item user defined tables and the transaction tables.

This program allows you to:

  • Deactivate specific fields by setting the Active Status field to inactive.

  • Attach a data item to a specific field.

When you deactivate a field, the field does not display and the system does not process any data in the field. This allows you to conceal fields that you are not using.

You can attach a data item to a user defined field for a specific data type. The system then uses the rules from the data dictionary for that data item, instead of the generic data item. The system either enters a default value if available, or verifies values, causing an error for invalid entries, for that field. This allows you to create a custom data item and apply the data dictionary default value, display rules, and rules to verify values for a user defined field in the user defined table. This does not apply to the row descriptions on the screen where the user defined data field displays. These field descriptions are from the vocabulary overrides for the screen. However, you can override the generic field descriptions on a screen by setting up unique vocabulary overrides for each Data Type field on the screen.

For example, you can attach the data item Address Number to the Number 1 field for the data type INT in the Customer Defaults-User Defined table (F03016). When you update or locate data type INT records, using the Customer Defaults-User Defined program (P03016), you can choose Field Level Help (F1) in the Number 1 field and the Name Search screen displays. You can then choose an existing Customer from the Address Book. Using Address Number with the Number 1 field only occurs when the data type is INT. For any other type of data in the Customer Defaults-User Defined program (P03016), the program processes Number 1 based on its generic data dictionary attributes.

The system stores a list of valid tables for which you can enter records in User Defined Codes (UDC) 00/UF. The entries in this UDC are hard-coded because you must modify the maintenance program for the table to use the records.

All of the user defined tables include additional fields for custom use that do not display in the program for the table. Adding records in this program with the Active Status field set to Active does not cause the program to display these fields, unless you customize the program. When you chose Field Level Help (F1) for the Field field, the program displays a list of all of the fields in the table and you can select and add a record for any of the fields. However, if you did not customize the program to display the field, the program ignores the active record. This does not apply to batch processing. Batch programs, such as the EDI programs, process all of the fields in the user defined tables and you can control that processing by adding a record in the User Data Field Control program.

You can leave the Active Status field blank, and the program enters the value from the data dictionary. If no record exists for the field, it is automatically set to Active. To deactivate a field, you must add a record in this program and set the Active Status field to inactive. You cannot deactivate a field if you define that field as a required field in the Required User Defined Fields program (P40061). You must first remove it as a required field before you can deactivate it.

You can leave the Data Item field blank and you can also access the Data Item Search screen to choose a data item by choosing Field Level Help (F1) in this field. When you choose a data item, it must match the type and size of the field. The only exception are those with an A (Alphanumeric) and O (Open) in the Type field, which the program treats as matching types. The data file decimals and display decimals for the data item must also match those for the field. Access the detail area to review the type, size, and data file decimals for the field.

Set the processing option if you want to enter a default value in the Data Type field.

To set up user data field control

Navigation

From Sales Order Management (G42), enter 27

From Sales Order Advanced & Technical Ops (G4231), choose User Defined Data Setup

From User Defined Data (G42313), choose User Data Field Control

  1. On User Data Field Control, complete the following fields:

    • Data Type

    • File ID

    • Field

  2. Complete the following optional fields and click Add.

    • Active Status

    • Data Item

Figure 2-1 User Data FIeld Control screen

Description of Figure 2-1 follows
Description of "Figure 2-1 User Data FIeld Control screen"

Field Explanation
Data Type A user defined code (40/UD) that allows user defined data to be separated and identified by the type of data.
File ID A user defined code (00/UF) that identifies the user defined or user reserved files eligible for User Data Item Control (P40060). This control allows you to turn off a field so that it does not display and is skipped by all processing.

It also allows you to attach an override data item to a field in the user data file, so that the edit rules from the data dictionary for the field come from the override data item.

All of the file IDs in user defined code table 00/UF are hard-coded.

Data Item For World, the RPG data name. This data field has been set up as a 10-byte field for future use. Currently, it is restricted to 4 bytes so that, when preceded by a 2-byte table prefix, the RPG data name will not exceed 6 bytes.

Within the Data Dictionary, all data items are referenced by this 4-byte data name. As they are used in database tables, a 2-character prefix is added to create unique data names in each table specification (DDS). If you are adding an error message, this field must be left blank. The system assigns the error message number using next numbers. The name appears on a successful add. You should assign error message numbers greater than 5000. Special characters are not allowed as part of the data item name, with the exception of #, @, $.

You can create protected data names by using $xxx and @xxx, where you define xxx.

Field The name of the field within the file. This name is constructed using the File Prefix specified in the SVR and the data item name in the data dictionary.
Active Status A status code that indicates whether or not a field in a user defined or user reserved file is active. When inactive, a field will not display and no processing of the field occurs. When a record is written to the file, the value of the inactive field will be blanks or zero, depending upon the data type.

Valid values are:

1-Active

0-Inactive


2.2 Setting Up Required User Defined Fields

The Required User Defined Fields program (P40061) allows you to mark user defined fields in user defined tables as required entry fields. You can use these required fields in only the following sales and purchase order transaction tables:

  • S.O. Header - User Defined (F42016)

  • S.O. Detail - User Defined (F42116)

  • P.O. Header - User Defined (F43016)

  • P.O. Detail - User Defined (F43116)

  • Shipment Header - User Defined (F42156)

When you add or change a record and enter a value in the Required field in this program, you are requiring the user to enter a value, other than zero (depending upon the data type), in the user defined field on a transaction screen. You can also mark the field as required for a specific address number or for all address numbers.

You can set either of the following requirements for the user defined field when the user does not enter a value in the field on a transaction screen:

  • Issue an error and do not allow the user to add or update the record

  • Issue only a warning

The system stores a list of valid tables for which you can enter records in UDC 40/UF. The entries in this UDC are hard-coded because you must modify the maintenance program for the table to use the records.

The Address Number and Required fields work in conjunction. You can enter a value in the Address Number field, mark the user defined field as required, and the requirement applies to only that address number. If you leave the Address Number field blank, mark the user defined field as required, the requirement applies to all address numbers. You can access the Name Search screen to choose an address number by choosing Field Level Help (F1) in this field.

Set the processing option if you want to enter a default value in the Data Type field.

The system stores the required user defined field data in the Required User Defined Fields table (F40061).

To set up required user defined fields

Navigation

From Sales Order Management (G42), enter 27

From Sales Order Advanced & Technical Ops (G4231), choose User Defined Data Setup

From User Defined Data (G42313), choose Required User Defined Fields

  1. On Required User Defined Fields, complete the following fields:

    • Data Type

    • File ID

    • Field

  2. Complete the following optional fields and click Add.

    • Address Number

    • Required

Figure 2-2 Required User Defined Fields screen

Description of Figure 2-2 follows
Description of "Figure 2-2 Required User Defined Fields screen"

Field Explanation
Required A code that specifies whether a field must have a value. Valid codes are:

' ' No value is required.

1 – A value is required and a hard error will be issued if the value is blanks or zero.

2 – A value is required but only a warning will be issued if the value is blanks or zero.


2.3 Setting Up User Defined Data Defaults

You use the User Defined Data Defaults program (P40062) to set up relationships between fields in user defined tables and fields in other tables, including other user defined tables. This relationship specifies the source of the default value for the user defined field.

You can set these defaults in only the following sales and purchase order transaction tables:

  • S.O. Header - User Defined (F42016)

  • S.O. Detail - User Defined (F42116)

  • P.O. Header - User Defined (F43016)

  • P.O. Detail - User Defined (F43116)

  • Shipment Header - User Defined (F42156)

After you define the relationship and add new records to the user defined table, the system retrieves the default value and enters it into the field in the user defined table.

On the User Defined Data Defaults screen, the File ID and Field fields represent the target fields into which the system enters values while the Default File and Default Field fields are the table and field from which the system extracts a value. The default tables you can use for each of the transaction tables are hard coded in a unique UDC table. The UDCs and tables are as follows:

  • S.O. Header - User Defined (F42016), UDC 40/F1

  • S.O. Detail - User Defined (F42116), UDC 40/F2

  • P.O. Header - User Defined (F43016), UDC 40/F3

  • P.O. Detail - User Defined (F43116), UDC 40/F4

  • Shipment Header - User Defined (F42156), UDC 40/F5

Following are the default files for each transaction file:

Target Table Default Tables (files)
S.O. Header-User Defined Data (F42016)
  • Customer Master (F0301)
  • Customer Defaults-User Defined (F03016)

S.O. Detail-User Defined Data (F42116)
  • F0301
  • F03016

  • Item Master (F4101)

  • Item Branch File (F4102)

  • Item Master - User Defined (F41166)

  • Item Branch - User Defined (F41266)

  • Sales Order Header File (F4201)

  • S.O. Header - User Defined (F42016)

Shipment Header - User Defined (F42156)
  • F0301
  • F03016

P.O. Header - User Defined (F43016)
  • Supplier Master (F0401)
  • Supplier Defaults-User Defined (F04016)

P.O. Detail - User Defined (F43116)
  • F0401
  • F04016

  • F4101

  • F4102

  • F41166

  • F41266

  • Purchase Order Header File (F4301)

  • P.O. Header - User Defined (F43016) (F4301)


When you select the Default File for an address number, for example, F03016, you must also select the default address type, such as sold-to, ship-to or mark-for. The mark-for address type is for Sales Order User Defined tables only. The system enforces the selection of a Default Address Type when the special handling code of the UDC entry for the Default File is set to 1.

Following are the rules you must follow to define default relationships between fields:

  • If the target field is numeric, the default field must also be numeric

  • The size of the target field must not be less than the default field

  • The number of data file decimals of the two fields must be the same

The field type, size, and number of data file decimals for the target Field display in the detail area of the detail line.

Defaults are only applicable when you add new user defined data records to the transaction tables, that is, they are not input on a change to existing data.

The system stores a list of valid tables for which you can enter records in UDC 40/UF. The entries in this UDC are hard-coded because you must modify the maintenance program for the table to use the records.

Each File ID field includes a list of valid default tables. The system stores the list in the special handling code for that File ID in UDC 40/UF. To select a Default File from the list, place the cursor in the Default File field and choose Field Level Help (F1).

To set up user defined data defaults

Navigation

From Sales Order Management (G42), enter 27

From Sales Order Advanced & Technical Ops (G4231), choose User Defined Data Setup

From User Defined Data (G42313), choose User Defined Data Defaults

  1. On User Data Defaults, complete the following field:

    • Data Type

    Figure 2-3 User Defined Data Default screen

    Description of Figure 2-3 follows
    Description of "Figure 2-3 User Defined Data Default screen"

  2. Complete the following fields in the detail area and click Add.

    • File ID

    • Field

    • Default File

    • Default Field

Field Explanation
Default File A user defined code (40/UF) that identifies the user defined files eligible for Required User Defined Fields (P40061) and User Defined Data Defaults (P40062).The former allows you to flag a field as required, so the user receives an error or a warning if no value is entered. The latter allows you to set up default values for the fields in the user defined file.

All of the file IDs in user defined code table 40/UF are hard-coded.

Default Field The name of the field that is the source of the default value.