Summary -
In this topic, we described about the below sections -
What is Table?
Table is a logical structure for storing data. Table is the set of rows and columns that are logically related. Table can be defined independent of the database in ABAP dictionary.
The table fields are defined with the database independent elementary data types and lengths. The physical table definition created in the database when the actual table activated in the data dictionary.
The ABAP data dictionary table definition is automatically translated to its database definition. The table definition in ABAP dictionary contains table fields, foreign keys, indexes etc.
Table field Definition -
Each table field should have their own definition in the table. The ABAP data dictionary table field have the below elements in its definition.
Element | Description |
---|---|
Field name | Specifies the field name of the table. The field name can have maximum 16 characters. The field name contains letters, digits and underscores. The field name must begin with a letter. |
Key flag | Specifies the field belongs to table key or not. |
Field type | Specifies the field data type in ABAP data dictionary. |
Field length | Specifies the number of valid characters in the field. |
Decimal places | Specifies the number of places after the decimal point. Applies on numeric data types. |
Short text | Describes the meaning of the field. |
Create Table -
Step-1: Go to SE11 transaction.
It opens ABAP Dictionary: Initial Screen
Step-2: Select Database table radio button and enter the table name. Click on "Create" button.
Step-3: It opens Dictionary: Change Table screen. Enter the Short Description, Delivery class and desired Data Browser/Table View Maint. Select desired Data Browser/Table View Maint value from the drop down.
Step-4: Open Fields tab to enter the table fields information. To specify the field is of specific custom data element type, the data elements should be predefined or created. In this case, all ZTC_* data elements are created earlier.
Step-5: Press "(Ctrl + S)" or "Save" icon to save the Table definition. System asks for the package by opening a new dialogue box. Enter existing package if any, or create new package.
Once entering the package information is completed, click on "Local object" (if the table is local and non transportable object) or "Save" icon to create the table.
Step-6: Once the table saved successfully, the “ZTC_TCUTOMER saved” message displayed on status bar.
Step-7: Once the table is saved successfully, click on "Technical Settings" on the application bar.
Step-8: It opens Dictionary: Maintain Technical Settings screen. Select appropriate Data Class from the list, Size Category and other options if required. Click on "Save" or "Ctrl + Ss"to save the changes.
Step-9: Now go back to Dictionary: Change Table Screen and click on Activate button or Ctrl +F3 to activate table.
Sometimes, while activating the table the below warnings might display.
These are enhancement related warning messages that requires to specify the table enhancement category. To resolve the above warnings, go to Extras -> Enhancement Category.., that opens the below information dialog box. Click on "Continue" to open below dialog box.
Select "Cannot Be Enhanced" on below screen and click on "Copy".
Step-10: Click on "Activate" icon or "Ctrl +F3" to activate table.
If the table activated successfully, the "Active object generated" message displayed on status bar like below.
Now, Table is activate and available for all the programs.
If error messages or warnings occurred during the activation of the table, the activation log displays automatically. The same activation log can navigate through menu option Utilities(M) → Activation log.
Change Table -
If any information in the table updated wrongly or adding/removing any new fields, Table definition requires to be changed. Change option is used to change the table properties and follow the below steps to change the table definition -
Step-1: Go to SE11 transaction.
It opens ABAP Dictionary: Initial Screen
Step-2: Enter the table name and click on the "Change" icon to edit the table information.
Step-3: Click on "Save" once the information modified. Verify the below message gets displayed on status bar.
Step-4: Click on "Activate" icon or "Ctrl +F3" to activate the new changes of the table. Verify the below message gets displayed on status bar.
Delete Table -
If we want to delete the existing table or a table is wrongly created, follow the below steps to delete table.
Step-1: Go to SE11 transaction.
It opens ABAP Dictionary: Initial Screen
Step-2: Enter the table name and click on the "delete" button.
It displays a "Delete Table" popup for confirmation, click on "Yes" to delete the table.
Once the table successfully deleted, the below message displays on status bar.