Show TOC Start of Content Area

Procedure documentationCreating Tables  Locate the document in its SAP Library structure

Prerequisites

You have created a Dictionary project.

More information: Development Process

Procedure

...

...

       1.      Select Database Tables in the Dictionary Explorer.

       2.      Choose Create Table from the context menu.

       3.      Enter a name for the table.

The following rules apply to table names:

       Table names must begin with a prefix (for example, the name of a component ‚FI_*’).

       The name of a table can be up to 18 characters long (inclusive of the prefix).

       Open SQL Keywords are not permitted. SELECT, INSERT, UPDATE, MODIFY and DELETE are some Open SQL Keywords.

       The permitted characters are: letters, numbers, and underscores.

Caution

Name reservation takes place when the Dictionary object is assigned to an activity (checked in to the Design Time Repository). If the name is already reserved, you can create the table, but you cannot save it in the DTR.  

       4.      In the field Description, enter a short description for the table.

       5.      To create new columns, choose Add Column.

       6.      To define one of the built-in data types as the type of the column, choose Built-in Type.

...

                            a.      Enter a name for the column in the Column Name field.

Caution

The name may only contain letters, digits, and underscores. The name must begin with a letter.

                            b.      In the Built-in Type field, choose a data type. The JDBC Type field is automatically set and provides information about the underlying, database-independent JDBC type that results from the selected built-in type and from the length entered for the field.

                            c.      Complete the Length, Decimals (decimal point precision), and Description fields if necessary.

                            d.      To enter a default value for the database, enter the value in the DB Default field.

More information: Initial Values

                            e.      If the field is part of a primary key, choose Key.

                              f.      If the field cannot accept and store null values, choose Not Null.

More information: Initial Values

       7.      To define a type defined in the Java Dictionary as the data type of the column, choose Simple Type.

                            a.      Enter a name for the column in the Column name field.

                            b.      Choose Browse and select the simple type to use from the Simple Type Selection dialog. Choose OK. The SAP NetWeaver Developer Studio completes the Simple type package, Built-in type, JDBC type, and Length fields automatically.

       8.      If necessary, create indices for the table.

More information: Creating Indexes

       9.      Choose the Table Buffering tab. Here you can define the buffering type for the table. The table can be buffered entirely or row by row. If the table contains more than one key field, generic areas can be buffered.

More information: Buffering Type

To exclude databases you are not using, choose Advanced. When you create a table, different checks are carried out. If no database is excluded, the checks will be based on all the specified databases.

Caution

Porting the table to a database may not be possible if you exclude the database.

   10.      Choose Save. All project data is stored and generated. When the data is saved, an XML description of the table is automatically created.

Note

If you wish the SAP NetWeaver Developer Studio to update XML table definitions automatically, choose Window   Preferences   Workbench and choose Perform build automatically on resource modification. To update table definitions manually, choose Project  Clean and set the Clean all projects indicator.

Caution

Tables should be created using the table editor only. You should not edit the XML files.

When a table is deleted, the XML file that is created is retained. The table contains the deleted addition in the Dictionary Explorer. If you wish to hide deleted tables, choose Menu(This graphic is explained in the accompanying text) Filters and set the Hide deleted Tables and Views indicator. Reservations for table names cannot be removed from the name server.

Result

The table is created in the Java Dictionary. The table can now be deployed. During deployment, the table and all the indexes are automatically created in the database (if not explicitly excluded when the index was defined).

More information: Deploying Tables

More Information

Creating Indexes

 

End of Content Area