SAP ABAP Database Table Creation: A Beginner’s Step-By-Step Guide

Thanmai Chandaka
5 min readJun 14, 2023

--

In SAP ABAP, creating tables is an essential skill for developers and administrators. Tables provide a structured way to store and manage data within the SAP system. This step-by-step guide will walk you through the process of creating tables in SAP ABAP, ensuring that you understand the necessary steps and techniques involved.

A Step-By-Step Guide to Creating Database Tables in SAP ABAP

Database Tables: Tables are used to store data in a structured format. In the Data Dictionary, you can define tables, and specify fields, data types, lengths, and other properties. Tables can also have foreign key relationships, indexes, and check constraints.

Data Elements: Data elements represent the domain-specific description of a table field. They define the semantic attributes of a field, such as the data type, length, and formatting information. Data elements are reusable and can be assigned to multiple fields across different tables.

Domains: Domains define the technical attributes of a data element, such as the data type, length, and input checks. They represent the lowest level of data definition and can be used to create data elements and specify field properties.

To create a database table in SAP ABAP, you can follow these steps:

  1. Open the ABAP Development Tools (ADT) in the SAP NetWeaver Developer Studio or the corresponding ABAP development environment.
SAP Easy Access Screen

2. Create a new ABAP dictionary object by navigating to the ABAP Dictionary transaction (SE11). Enter the table name & choose the option to create a new table (Database table).

SAP ABAP Data Dictionary Initial Screen

3. Provide a descriptive name for the table.

Define the table’s technical settings, such as the table category and delivery class.

DDIC Delivery & Maintenance

4. Go to the “Fields” tab and start entering Fields and Data Element names.

DDIC Empty Table

5. First enter the client number field (MANDT), and select the check boxes (Key, Initial Value). Also, enter the standard data element into the client number field (MANDT) and press enter.

<<Note: Even though we don’t check the initial value check box, the system will provide initial values by default in case of null entries.>>

Client Number Field SAP ABAP

Step 6. Now, enter the first field name (STD_ID).

If it is a key value, check the “Key” checkbox.

Create “Data Element” of this field, it should start with “Z” (ZSTD_ID).

Double-click on the “Data Element” to create a domain, and select the yes icon on the below pop-up window.

Then save the package as “Local Object” in the below pop-up.

Local Object SAP ABAP

Now enter the “Short Description” and “Domain” in the below screen and double-click on that particular domain name.

DOmain, Data Type SAP ABAP

Now you can see the below screen, here you can define Data type, No. of chars, Decimal Places, and enter.

Domain in SAP ABAP

The system will automatically take the output length. If you want you can check the “Lowercase” option.

If you want to specify some more properties you can go to the “Value Range” tab and define some Fixed Values, Intervals like Lower limit, Upper limit.

Once you are done specifying the properties, click on the “Activate” button and activate the domain.

Now go back and open the “Field Label” tab and fill in the field labels of all lengths and enter. The length will automatically be filled by the system once you click enter.

Field Label, Data Element in SAP ABAP

Now save and activate.

8. Repeat step 7 for each field you want to add to the table.

9. Save your changes.

Database Table in SAP ABAP

10. If necessary, assign a primary key to the table by selecting the Keys option in the menu and defining the primary key fields.

11. Open technical settings and fill the required fields like “Data Class” & “Size Category”.

Technical Settings in SAP ABAP

12. Save and activate the table.

13. Your database table is now created in SAP ABAP.

14. To create entries in the DB Table, In the header menu Click on Utilities -> Table Contents -> Create Entries.

Creating Table Entries in SAP ABAP

Enter the values, save the entries, and then create new entries.

15. If you want to see the entries of the table, then go back to the fields and click on the “Contents” button.

Contents Button in SAP ABAP
Contents Button

16. Here, either you can enter these from and to limits or you can directly click on the “Execute” button.

EXEcute Button in SAP ABAP
Execute Button

It is important to note that the exact steps and terminology may vary slightly depending on the version of SAP you are using and the specific development environment you are working with.

--

--