6 Columns with Active Background
Active List Item Background

24DDIC1907 – ABAP Essentials: Differentiating Internal Tables and Database Tables

In the SAP ABAP (Advanced Business Application Programming) environment knowing the difference between internal tables and database tables is crucial for efficient data handling. Both serve unique purposes and are integral to SAP application development.

What are Database Tables?

Database tables are used for permanent data storage within the SAP system. These tables are defined in the Data Dictionary (DDIC) and manage data persistently.

Key Points:

Persistent Storage:  Data remains even after program execution.

Data Integrity: Enforces constraints like primary and foreign keys.

SQL Access: Data is accessed via SQL statements.

Example:

Sql syntax

CREATE TABLE ZPRODUCTS (

    PRODUCT_ID INT PRIMARY KEY,

    NAME VARCHAR(100),

    PRICE DECIMAL(10, 2)

);

What are Internal Tables?

Internal tables are temporary storage structures used during ABAP program execution. They hold data in memory for processing.

Key Points:

Temporary Storage: Exists only during program runtime.

Flexible Structure: Can be dynamically modified.

In-Memory Processing: Ideal for sorting, filtering and aggregating data.

Example:

DATA: lt_products TYPE TABLE OF zproducts.

 

Usage Example:

SELECT * FROM zproducts INTO TABLE lt_products WHERE price > 100.

LOOP AT lt_products INTO DATA(ls_product).

  WRITE: / ls_product-name, ls_product-price.

ENDLOOP.

 

Key Differences

  1. Lifespan:

   Database Tables: Persistent.

   Internal Tables: Temporary.

  1. Storage:

   Database Tables: Stored in the database.

   Internal Tables: Stored in memory.

  1. Access:

   Database Tables: Accessed via SQL.

   Internal Tables: Manipulated via ABAP.

When to Use Each?

Database Tables:  Use for persistent data storage with integrity constraints.

Internal Tables:  Use for in-memory data processing during program execution.

Author : Aniket Pawar, 9373518385                               

6 Columns with Active Background

24DDIC1907 – ABAP Essentials: Differentiating Internal Tables and Database Tables

In the SAP ABAP (Advanced Business Application Programming) environment knowing the difference between internal tables and database tables is crucial for efficient data handling. Both serve unique purposes and are integral to SAP application development.

What are Database Tables?

Database tables are used for permanent data storage within the SAP system. These tables are defined in the Data Dictionary (DDIC) and manage data persistently.

Key Points:

Persistent Storage:  Data remains even after program execution.

Data Integrity: Enforces constraints like primary and foreign keys.

SQL Access: Data is accessed via SQL statements.

Example:

Sql syntax

CREATE TABLE ZPRODUCTS (

    PRODUCT_ID INT PRIMARY KEY,

    NAME VARCHAR(100),

    PRICE DECIMAL(10, 2)

);

What are Internal Tables?

Internal tables are temporary storage structures used during ABAP program execution. They hold data in memory for processing.

Key Points:

Temporary Storage: Exists only during program runtime.

Flexible Structure: Can be dynamically modified.

In-Memory Processing: Ideal for sorting, filtering and aggregating data.

Example:

DATA: lt_products TYPE TABLE OF zproducts.

 

Usage Example:

SELECT * FROM zproducts INTO TABLE lt_products WHERE price > 100.

LOOP AT lt_products INTO DATA(ls_product).

  WRITE: / ls_product-name, ls_product-price.

ENDLOOP.

 

Key Differences

  1. Lifespan:

   Database Tables: Persistent.

   Internal Tables: Temporary.

  1. Storage:

   Database Tables: Stored in the database.

   Internal Tables: Stored in memory.

  1. Access:

   Database Tables: Accessed via SQL.

   Internal Tables: Manipulated via ABAP.

When to Use Each?

Database Tables:  Use for persistent data storage with integrity constraints.

Internal Tables:  Use for in-memory data processing during program execution.

Author : Aniket Pawar, 9373518385