How to create database table in SAP ABAP
The database table in data dictionary can be created by two methods, i.e.
- Direct method / Predefined type
- Data element type
Technical requirements to create table
- In SAP ABAP, the name of table should start with word “Y” or “Z”, because A -> X words reserved for SAP
- Provide the deliver class that defines the owner of table and it controls to transfer the data from one table to another table
- Provide the technical settings & category size
Create Database table using direct method / Predefined type
Step 1: Execute SAP Tcode “SE11” in the SAP command field.
Step 2: In next screen “ABAP Dictionary: Initial Screen” update the following details
- Choose the database table radio button and
- Enter the required name of database table in the field. The name of table should be start with only Y or Z as we discussed earlier.
- After entering table name, click on create button
Step 3: In next screen “Dictionary: Maintain table” enter the following details
- Enter the short description of table
- Deliver class: Update the deliver class as “A” (Application table (master and transaction data). You can choose deliver class from the list.
- Data browser / Table view maintain: Choose display/maintenance allowed from drop down.
After maintaining all the required details in delivery and maintenance tab, choose the fields tab.
Step 4: Click on predefined type option as shown below image.
Step 5: In the fields screen, enter the following details.
- Field Name: Update the name of field
- Key: Choose the option key for the field to activate the field as the table key
- Data type: Choose the data type i.e. Numerical or Character
- Length: Update the allowed length for the field to be updated.
After maintaining all the required details, click on save icon to save the maintained database table in SAP ABAP. A window”create object directory entry” displays to enter the package name. Click on local object.
Press enter to continue. Now a message displays as “ZEMPLOYEE” created.
Activate database table
After maintaining new database table in SAP, next step is activation of table.
To activate table, click on Goto –> Technical Settings or use keys Ctrl+Shift+F9.
In next screen, Dictionary: Maintain technical settings, enter the following details
- Data class: Enter the data class from drop down
- Size category: Update the size category for the table that specifies the size required for table.
Click on save icon and save the technical settings in SAP.
Click on back and click on activate icon (Ctrl+F3) to activate the created database table in SAP.
Successfully we have created database table in SAP ABAP.