DATABASE TABLES – STUDY NOTES
Overview
In ABAP Dictionary, a database table is a database-independent definition of a database table. It is a two-dimensional matrix consisting of rows and columns (fields).
Key Concepts
Table Key
⬡A field or combination of fields that uniquely identifies every row in a table
⬡Must be a minimal attribute: removing any key field would prevent unique identification
Primary Key
⬡Required for every table
⬡Defines the table’s identity and uniqueness constraints
Foreign Key
⬡In the relational model, expresses the relationship between objects
⬡Links tables together based on primary key references
Table Naming Rules
Rule Description
Max Length 16 characters
Allowed Characters Letters, numbers, underscores
First Character Must be a letter
Namespace Prefix Optional prefix /…/ from prefix namespace
Namespace Locations
⬡Located in namespace of data types in ABAP Dictionary
⬡Located in namespace of global object types in the class library
Table Definition Components
A database table definition consists of:
Structure – Flat, non-nested structure in ABAP Dictionary
⬡Technical attributes
⬡Semantic attributes
Technical Attributes – Database-specific properties
Semantic Attributes – Business meaning and context
Table Category: Transparent Table
The most common table type is the transparent table.
Activation Process
When a table is activated:
Platform-specific SQL DDL CREATE TABLE statement is generated
Physical database table created in the ABAP database schema
All indexes are created (if not explicitly excluded)
Key Points
⬡Built-in types in ABAP Dictionary are implemented as database-specific types
⬡Table can be displayed via: Utilities → Database Object
Field Order
Important Behavior
Aspect Description
Dictionary vs Database Field order in ABAP Dictionary and on database do not need to match
Key Fields Key field order must match
Non-Key Fields Can be reordered without modifying database object
Access Methods
Method Order Handling
ABAP SQL Handled by database interface; Dictionary order applies
Native SQL Must explicitly apply database column order
AMDP Results in same order as ABAP Dictionary (if possible)
Global Temporary Tables (GTT)
Special tables for saving temporary data within a work step:
⬡Created in ABAP Dictionary
⬡Automatically truncated after transaction/session ends
⬡Useful for intermediate calculations
Creating Database Tables
Methods
Method Tool/Transaction
Form-based Transaction SE11
Source-code-based Dictionary DDL in ABAP Development Tools (ADT)
Table Modification Considerations
Conversions
When existing database tables are modified, conversions may be necessary to synchronize the physical database with the dictionary definition.
Best Practices
Do not access ABAP Dictionary tables directly in the database
Use ABAP SQL for all table access
Consider CDS views as replacement objects for transparent tables
Enhancement Options
To enhance SAP-delivered tables without modification:
Enhancement Type Description
Customizing Includes Include tables for customer-specific fields
Append Structures Add fields to existing tables
Replacement Objects
CDS views can be defined as replacement objects for transparent tables:
⬡ABAP SQL reads access the replacement object, not the original table
⬡Enables transparent data access changes
Important Notes
Never access ABAP-managed tables directly in the database
Use ABAP SQL for all database access
CDS views can replace transparent tables for reads
Append structures and customizing includes allow safe enhancements
Transaction Codes
Transaction Purpose
SE11 ABAP Dictionary (table definition)
SE16 Data Browser (table contents)
SE16N General Table Display
Key Takeaways
Database tables in ABAP Dictionary are database-independent definitions
Primary key is mandatory for every table
Transparent tables create physical database objects on activation
Field order in Dictionary can differ from database
Use ABAP SQL, not Native SQL, for table access
Global Temporary Tables for temporary data storage
Append structures for safe SAP table enhancements
TERMINAL_INPUT >
Content Source: https://help.sap.com/
If you have problem, please fell free to contact.Thanks.
About me:
This post is come from www.hot583.com, you can share/use it with the post original link for free.
But pay attention of any risk yourself.
If you like, Fell free to let your friends know this. Thanks.
