Learn SAP Free
Back to Dashboard
Data Dictionary

How to Create Custom Tables in SAP ABAP — Complete SE11 Guide

Daksh | May 14, 2026 | 15 min read

How to Create Tables in SAP ABAP

When business users ask for a new feature in SAP, nine times out of ten, standard SAP tables won’t fit the exact business requirement.

For example, a manufacturing client needed to track custom quality inspection approvals for raw steel deliveries. Standard SAP Material Management (MM) stores purchase orders in EKKO and material movements in MSEG, but it has no standard place to record custom inspector digital signatures, lab test results, and regional clearance IDs.

To solve this, we created a custom Transparent Table in transaction SE11 named ZQUALITY_INSP.

Creating database tables is a fundamental skill for any ABAP developer. Every custom SAP solution — whether it is a Fiori application, a custom background program, an ALV report, or a BTP cloud integration — relies on custom tables to store persistent data safely.

This guide provides a comprehensive step-by-step masterclass on creating, configuring, and maintaining database tables in SAP ABAP using transaction SE11.


What is a Database Table in SAP ABAP?

A database table in SAP ABAP is a two-dimensional matrix stored on the underlying database server. It organizes enterprise data into rows (records) and columns (fields).

Table: ZEMPLOYEE_MASTER (Transparent Table)

MANDT │ EMP_ID     │ FIRST_NAME │ LAST_NAME │ DEPT_ID │ SALARY    │ JOIN_DATE
──────┼────────────┼────────────┼───────────┼─────────┼───────────┼───────────
100   │ 0000100001 │ Rahul      │ Sharma    │ IT01    │ 85000.00  │ 20240115
100   │ 0000100002 │ Ananya     │ Verma     │ HR02    │ 72000.00  │ 20240301
100   │ 0000100003 │ Vikram     │ Singh     │ FIN01   │ 95000.00  │ 20231110

Every database table in SAP consists of:

  • Client Field (MANDT): Enables client-dependency so different SAP clients (e.g., Client 100, Client 200) share the same table structure without seeing each other’s private records.
  • Primary Keys: One or more fields that uniquely identify every row in the table.
  • Data Fields: Non-key columns containing actual attribute values.
  • Technical Settings: Configurations controlling physical tablespace allocation, size categories, and memory buffering.

Standard Tables vs Custom Z-Tables

SAP delivers over 100,000 standard database tables out-of-the-box:

  • MARA — Material Master General Data
  • VBAK — Sales Document Header Data
  • VBAP — Sales Document Item Data
  • KNA1 — Customer Master General Data
  • LFA1 — Vendor Master General Data
  • BKPF — Accounting Document Header
  • BSEG — Accounting Document Segment (Line Items)

Rules for Custom Tables:

  1. Naming Namespace: Custom table names must start with Z or Y (e.g., ZEMPLOYEE_TABLE, YCUSTOMER_MOD).
  2. Never modify standard tables directly: If you need to add custom fields to a standard SAP table (like MARA), use Append Structures or CI Includes — never alter the standard table directly.

Essential Components Before Creating a Table

Before opening SE11 to create a table, you need to design three fundamental elements:

┌─────────────────────────────────────────────────────────────┐
│                 Table Field Design Architecture             │
├─────────────────────────────────────────────────────────────┤
│ 1. MANDT (Client Field) — Required for Client-Dependent Data│
│ 2. Primary Key Fields   — Uniquely Identifies Each Row      │
│ 3. Data Elements        — Defines Semantic Labels & Titles  │
│ 4. Domains              — Defines Data Types, Length & Rules│
└─────────────────────────────────────────────────────────────┘

1. Client Dependency (MANDT Field)

In SAP, a single system installation can contain multiple logical tenants called Clients (e.g., Client 100 for testing, Client 200 for training).

To make your table client-dependent, the very first field must be named MANDT (or CLIENT), checked as a Primary Key, and assigned the standard Data Element MANDT.

When an ABAP program executes a SELECT statement on a client-dependent table, Open SQL automatically filters results by the user’s current login client (SY-MANDT).


2. Primary Key Design

A Primary Key consists of one or more fields whose combination MUST be unique across all rows in the table.

  • In ZEMPLOYEE_MASTER, the combination of MANDT + EMP_ID is the Primary Key.
  • In ZORDER_ITEMS, the Primary Key is MANDT + ORDER_NO + ITEM_NO.

If a user tries to insert a row with a duplicate primary key combination, the database rejects the operation and triggers a short dump (DABP_UNIT_DUPLICATE_KEY or DBIF_RSQL_INVALID_RSQL).


3. Data Elements and Domains

Every field in an ABAP table references a Data Element, which in turn references a Domain.

  • Domain: Sets physical storage rules (e.g., CHAR 10, NUMC 8, CURR 15,2).
  • Data Element: Sets business descriptions and column headers shown on Fiori apps and SAP GUI screens.

Step-by-Step: Creating a Custom Table in SE11

Let’s walk through creating a custom table ZSTUDENT_MASTER to store student records.


Step 1: Open Transaction SE11

  1. In the SAP GUI command field, type /nSE11 and press Enter.
  2. Select the Database table radio button.
  3. Type ZSTUDENT_MASTER.
  4. Click Create.

Step 2: Configure Header Attributes and Delivery Class

  1. In Short Description, enter: "Student Master Data Table".
  2. Switch to the Delivery and Maintenance tab:
    • Delivery Class: Select A (Application table for master/transaction data).
    • Data Browser/Table View Maint.: Select Display/Maintenance Allowed.
Delivery Class Options:
A = Application table (Master and transaction data)
C = Customizing table (Maintained by customer, transported)
L = Temporary data table

Step 3: Define Table Fields

Switch to the Fields tab. Enter the following columns:

FieldKeyInitData ElementData TypeLengthShort Description
MANDTXXMANDTCLNT3Client
STUDENT_IDXXZDE_STUDENT_IDNUMC8Student ID Number
FIRST_NAMEZDE_FIRST_NAMECHAR40First Name
LAST_NAMEZDE_LAST_NAMECHAR40Last Name
COURSE_CODEZDE_COURSE_CODECHAR10Enrolled Course
ENROLL_DATEDATUMDATS8Date of Enrollment

Define Fields in SE11 Screen


Step 4: Configure Technical Settings

Click the Technical Settings button in the toolbar (or press Ctrl + Shift + F1).

  1. Data Class: Select APPL0 (Master Data).
  2. Size Category: Select 0 (0 to 8,000 expected records).
  3. Buffering: Select Buffering Not Allowed (or Buffering Allowed but Switched Off).
  4. Click Save (Ctrl + S) and return to the main table screen (F3).

Technical Settings Dialog


Step 5: Save and Activate

  1. Press Ctrl + S to save the table. Assign it to a local package ($TMP) or transport request.
  2. Press Ctrl + F3 to activate.

SAP compiles the Dictionary object and generates the physical database table structure on the underlying database server. You should see the message: "Object activated".


Maintaining Table Data with SE16N

Once your table is active, you need a way to insert, edit, and view records.

Transaction SE16N (General Table Display) is the standard tool used by developers and consultants to inspect and maintain table entries.

Step-by-Step Data Entry in SE16N:

  1. Type /nSE16N in the command field.
  2. In the Table field, enter ZSTUDENT_MASTER.
  3. Type &SAP_EDIT in the command field and press Enter (enables edit mode if authorized).
  4. Click Execute (F8).
  5. Click Add Row (or press F6).
  6. Enter student data in the grid rows:
STUDENT_ID │ FIRST_NAME │ LAST_NAME │ COURSE_CODE │ ENROLL_DATE
───────────┼────────────┼───────────┼─────────────┼────────────
10000001   │ Rahul      │ Sharma    │ CS101       │ 2026-08-01
10000002   │ Ananya     │ Verma     │ IT202       │ 2026-08-02
  1. Click Save (Ctrl + S). SAP writes records directly to the physical table.

SE16N Initial Screen


Interacting with Custom Tables in ABAP Code

As an ABAP developer, you interact with custom database tables using Open SQL statements inside your programs:

REPORT z_student_demo.

" 1. Read data from custom table using SELECT
SELECT *
  FROM zstudent_master
  INTO TABLE @DATA(lt_students)
  WHERE course_code = 'CS101'.

IF sy-subrc = 0.
  LOOP AT lt_students INTO DATA(ls_student).
    WRITE: / ls_student-student_id, ls_student-first_name, ls_student-last_name.
  ENDLOOP.
ENDIF.

" 2. Insert a new row using INSERT
DATA(ls_new_student) = VALUE zstudent_master(
  student_id  = '10000003'
  first_name  = 'Vikram'
  last_name   = 'Singh'
  course_code = 'ME301'
  enroll_date = sy-datum
).

INSERT zstudent_master FROM @ls_new_student.

IF sy-subrc = 0.
  COMMIT WORK.
  WRITE: / 'New student record created successfully!'.
ENDIF.

Quick Checkpoint — Test your understanding

Question 1: Why is the MANDT field required as the first primary key field in custom application tables?

Answer: To make the table client-dependent. This ensures different logical SAP tenants (clients) share the same table structure while keeping their private data isolated.

Question 2: Which transaction codes are used to create a table and to maintain table data records?

Answer: Transaction SE11 is used to create and alter table structures. Transaction SE16N (or SE16) is used to display and maintain table records.

Question 3: What happens if an ABAP program attempts to insert a record into a custom table with a primary key combination that already exists?

Answer: The database operation fails and sets sy-subrc = 4 (or triggers a duplicate key short dump if direct SQL insertion fails).


Common mistakes to avoid

Mistake 1: Forgetting to activate Technical Settings. If you define fields on a table in SE11 but forget to set Data Class and Size Category in Technical Settings, SAP will block table activation with the error "Technical settings missing".

Mistake 2: Changing primary key structure on populated tables. Changing key fields on a table that already contains 500,000 rows requires a database table conversion (transaction SE14). Doing this without taking a database backup can lead to data truncation or corrupted primary keys.

Mistake 3: Omitting the Initial Value checkbox on mandatory key fields. Always check the Initial Value checkbox for key fields on custom tables. This ensures NULL database values are automatically converted to space/zero default values in Open SQL queries.

Mistake 4: Hardcoding client numbers in ABAP SELECT statements. Never write WHERE mandt = '100' in Open SQL queries. Open SQL handles client filtering automatically via sy-mandt. Hardcoding client numbers breaks portability across QA and Production landscapes.


Related reads on this site:

Daksh Dedha - SAP Technical Consultant

Written by Daksh Dedha

SAP Technical Consultant

Daksh is an SAP Technical Consultant specializing in ABAP programming, SAP S/4HANA migrations, Fiori development, and BTP cloud architecture. He authors free, hands-on tutorials to make enterprise SAP education accessible to all developers.

Test Your Knowledge

SAP Challenge Question 1 of 10

Loading question...

Found this tutorial useful? Share it with your SAP development team.