Show TOC

 Creating Table TypesLocate this document in the navigation structure

Procedure
  1. Open the Repository Browser and navigate to the package in which you want to create the table type.
  2. In the context menu of the package, choose Create → Dictionary Object → Table type.

    A dialog box appears.

  3. In the new dialog box, enter the name of the table type and choose  with the quick info text Continue.

    The maintenance screen for table types appears.

  4. In the Short text field, enter an explanatory short text.

    You can find the table type at a later time using this short text, for example.

  5. On the Line type tab page, define the line type of the table type. To do this, perform one of the following:
    • Select the Line Type radio button. You can now refer to an existing type (data element, structure, table, view, table type). You can either search for an existing type or you can directly enter the line type in the Line Type field.
    • If you want to enter the data type, field lengthand the number of decimal places directly, you must select the Predefined Type radio button. Entries are now possible in the fields Data Type, No of characters and Decimal Places.
    • If you want to use a reference type as the line type, select the Reference type radio button and then Name of Ref. Type. Enter the name of the referenced type. This can be the name of a class or an interface, a generic reference to ANY, OBJECT, or DATA or a reference to a type defined in the Dictionary. If you want the reference type to be a predefined Dictionary type, choose Reference to Predefined Type. Select the Data Type, the Length and the number of Decimal Places.
  6. On the Initialization and Access tab page, define the access mode of the table type.

    This defines how to access the data in an internal table defined by the table type in ABAP programs.

  7. On the Primary Key tab page, define the primary key of the table type.

    The primary key of a table type is defined by the key definition and the key category .

    If you select the Key components radio button, you can define the primary key of the table type directly in the input area with the same name.

    Caution

    This option is possible only if the row type of the table type is a structure, table or view.

    You can display all the components of the row type by choosing Choose components. Select the components that you want to copy to the key, using the indicator in the first column and choose  with the quick info text Cont..

    You can define (optional) an alias name for the primary key of the table type. It enables you to address the primary key using a self-defined name, like a secondary key.

    Caution

    The alias name and the names of the secondary keys must be unique. These names must also meet the naming conventions.

    For more information about the constraints when creating an alias name, open the F1 help for the Alias field.

  8. On the Secondary Key tab page, define (optional) the secondary keys of the table type.

    To create a secondary key, perform the following:

    1. Choose  with the quick info text Create Secondary Key.
    2. In the Secondary Key field, enter the name of the secondary key.
    3. In the Short Description field, enter an explanatory short text (optional).
    4. Define the Key Access and the Key Definition for the secondary table key.

      If you select the Key components radio button, you can define the key of the table type directly in the input area with the same name.

      You can display all the components of the row type with Choose components. Select the components that you want to copy to the key using the indicator in the first column, and choose  with the quick info text Cont..

      Note

      The order in which you define the components of a table key is significant.

    5. Choose  Refresh List.

      The new secondary key appears in the list.

  9. Choose  with the quick info text Save.

    The system asks you to assign the table type to a package. You can change this package later by choosing Goto → Object directory entry.

  10. Choose  with the quick info text Activate.
Result

The table type is now activated. The runtime object of the type is created. At activation the system writes a log. It can be displayed by choosing Utilities → Activation log. If errors occur during activation, the system automatically displays the activation log.

Additional Options

  • You can enter an explanatory text for the table type by choosing Goto → Documentation. This is technical documentation that is not displayed in the online help system.
  • You can display the runtime object of the table type by choosing Utilities → Runtime object → Display. By choosing Utilities → Runtime object → Check you can check if the runtime object of the table type is consistent with its definition on the maintenance screen of the ABAP Dictionary.