
Tables can be defined in the Java Dictionary independently of the database. For each table definition stored in the Java Dictionary, a physical table definition is created in the database when the table is deployed.
Use this procedure to create tables in Java Dictionary.
Tables can be defined in Java Dictionary independently of the database. For each table definition stored in the Java Dictionary, a physical table definition is created in the database when the Dictionary development component is deployed. The table definition is translated from Java Dictionary to a definition of the particular database.
A table definition in Java Dictionary contains the following components:
Table fields
Here you specify the names and data types of the columns contained in the table.
Key fields
Using key fields, you define the columns through which data records of a table are uniquely defined.
Technical settings
The technical settings control table buffering, for example.
Indexes
To speed up data selection, you can create secondary indexes for the table.
You have created a Dictionary development component.
For more information, see Creating Dictionary Development Components .
1. Create the table.
In the Dictionary Explorer , select the Dictionary DC where you want to store your new table.
In the context menu, choose .
The New Database Table wizard opens.
Specify a name for the table.
The following rules apply to table names in Java Dictionary:
Table names must begin with a prefix (such as the name of a component, FI_* ).
The name of a table can be up to 18 characters long (including the prefix).
Open SQL keywords are not permitted. For example, SELECT , INSERT , UPDATE , MODIFY , DELETE .
The permitted characters are: letters, numbers, and underscores.
Name reservation takes place when the Dictionary object is assigned to an activity, that is, when it is checked in to the Design Time Repository (DTR). If the name is already reserved, you can create the table, but you cannot save it in the DTR.
Choose Finish .
The SAP NetWeaver Developer Studio creates the table and opens it for editing.
(Optional) In the Description field, enter a short description for the table.
2. Add columns to the table.
To create a new column, choose the
pushbutton.
The Create a Column dialog opens.
Enter a name for the column in the Column Name field.
The name must begin with a letter and can contain only letters, digits, and underscores.
Specify other settings of the column.
Define one of the built-in data types as the type of the column.
In the Built-In Type field, select 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.
If necessary, complete the Length , Decimals (decimal point precision) and Description fields.
To specify a database default value, enter that value in the DB Default field.
For more information, see Initial Values .
If this is a primary key column, select the Key checkbox.
If the column must not contain NULL values, select the Not Null checkbox.
For more information, see Initial Values .
Define a type, which is already defined in Java Dictionary, as the data type of the column.
Choose Browse and select the simple type to be used from the Simple Type Selection dialog.
Choose OK .
The SAP NetWeaver Developer Studio completes all of the relevant fields automatically.
If this is a primary key column, select the Key checkbox.
Choose Finish .
To save your data, choose Save .
3. If necessary, create indexes for the table.
For more information, see Creating Indexes .
4. (Optional) Modify table properties.
Choose the Technical Settings tab.
Enable table buffering.
To use table buffering, you must have defined one or more primary keys of 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.
For more information about the types of buffering, see Buffer Granularity .
For more information about the table buffer, see Table Buffer .
Select the Enable Buffering checkbox.
Select a buffering type from the Table Buffering dropdown list.
Specify database specific parameters for the table.
For more information, see Specifying Database-Specific Parameters .
If you do not want to create the table on particular databases, expand the Advanced Settings and select the databases you want to exclude.
When you create a table, different checks are carried out. If no database is excluded, the checks are based on all the specified databases.
Porting the table to a database may not be possible if you exclude the database.
When a table is deleted, the relevant XML file is retained. The table name in the Dictionary Explorer contains “deleted” .
To hide or show the deleted tables in the Dictionary Explorer , choose , select or deselect the Hide Deleted Tables and Views checkbox, then choose OK .
Reservations for table names cannot be removed from the name server.
To save your data, choose Save .
All project data is stored and generated. When the data is saved, an XML description of the table is automatically created.
If you want the SAP NetWeaver Developer Studio to update XML table definitions automatically, choose and select the Build Automatically checkbox. To update table definitions manually, choose and select the Clean All Projects checkbox.
Tables must be created and edited using the table editor only. Do not change the corresponding XML files manually.
The table is created in Java Dictionary. The table can now be deployed on the database. During deployment, the table and all the indexes are automatically created in the database (if not explicitly excluded when in the index definition).
For more information, see Deploying Dictionary Development Components .