Creating Database Tables and Table Fields

Procedure

To create a table, proceed as follows:

  1. Open the Repository Browser (transaction code SE80) and navigate to the package in which you want to create the database table.
  2. In the context menu of the package, choose Start of the navigation pathCreate Next navigation step Dictionary Object Next navigation step Database TableEnd of the navigation path.

    A dialog box appears.

  3. Enter the name of the database table and choose .

    The maintenance screen for the table appears.

  4. Enter an explanatory short text in the Short Description field.
  5. On the Delivery and Maintenance tab, assign the table to a development class, enter a Delivey Class.
  6. Choose an entry from the dropdown box for the Data Browser/Table View Maint. field.

    If users with the corresponding authorization can change data in the table using the Data Browser (transaction code SE16), choose Display/Maintenance Allowed

  7. Choose .

    The Information dialog is opened.

  8. To confirm, choose .

    The Maintain Enhancement Category dialog is opened.

  9. To define if the database tables that are delivered by SAP can be enhanced, choose an enhancement category.
  10. Confirm the selection by choosing .

    The Create Object Directory Entry dialog is opened.

  11. Choose .

    The maintenance screen for the table is opened and the database table is added in the Repository Browser. The database table object is created in the ABAP Dictionary.

Procedure

After creating a database table, you can add table fields to it. For this, proceed as follows:

  1. On the maintenance screen of the database table, select the Fields tab page.
  2. Switch to the edit mode and perform the following steps for each table field:
    1. Enter a name for the table field in the Field column.
    2. Select the Key column if the field must be part of the table key.
    3. You can enter the attributes data type, length, decimal places and short description in two ways:
      1. If you choose the Predefined type, you can enter the name of an existing data element in the Data element field. In this case, the field takes the data type, length, decimal places and short description from this data element. If there is no suitable data element, you can go to the data element maintenance screen by entering a name and double-clicking on it.
      2. If you choose Data element, you can directly enter the data type, length, decimal places and short description.
  3. You must also define the reference field and reference table on the Currency/Quantity fields tab page, for fields of types CURR (currency) and QUAN (quantity).
  4. Save and activate the database table.

Result

During activation, the system automatically creates the table and all the indexes on the table in the database (if not explicitly excluded when the index was defined). You can display the table definition in the database by choosing Start of the navigation pathUtilities Next navigation step Database object Next navigation step DisplayEnd of the navigation path.

At activation, the runtime object for the table is also created. You can display the runtime object by choosing Start of the navigation pathUtilities Next navigation step Runtime object Next navigation step DisplayEnd of the navigation path.

You can find information about the activation flow in the activation log, which you can display by choosing Start of the navigation pathUtilities Next navigation step Activation logEnd of the navigation path. The system displays the activation log automatically if errors occur when the table is activated.