Structured Query Language (SQL)
![](/service/media/topic/df026ee6-8769-4a24-a451-3d6621e6922b/S4D400_24_en-US_media/S4D400_24_en-US_images/12_-Basic_ABAP_SQL_001.png)
All relational database systems use a variant of Structured Query Language (SQL) to allow you to work with them. Standard SQL consists of three main components:
- Data Manipulation Language (DML)
- DML comprises of the statements that you need to work with information in database tables. These are INSERT, for adding new records, SELECT, for reading data, UPDATE, to change existing records, and DELETE, to delete table contents. These statements are reflected in ABAP in the form of ABAP SQL.
- Data Definition Language (DDL)
- Data Definition Language provides you with commands that enable you to create and delete database tables and other database artifacts such as schemata, table indexes, and views. In an SAP system, you perform these tasks using dedicated editors of ADT, not with ABAP programs. One example is the editor for database table definitions we saw earlier.
- Data Control Language (DCL)
- Data Control Language is used in SQL to restrict access to data in the database for a particular user. It is not used in its classic form in ABAP, since the users at database level do not correspond one-to-one with the end users. Consequently, ABAP has its own authorization concept.
ABAP SQL Architecture
![](/service/media/topic/df026ee6-8769-4a24-a451-3d6621e6922b/S4D400_24_en-US_media/S4D400_24_en-US_images/12_-Basic_ABAP_SQL_002.png)
In the past, SAP systems had to support a range of database platforms, and each platform had a slightly different implementation of the SQL standard. This meant that each platform needed slightly different commands to achieve a particular task. To avoid the ABAP code being database-specific, SAP invented ABAP SQL - or Open SQL as it was called originally.
Note
The name change from Open SQL and ABAP SQL also illustrates that as off release 7.53 ABAP only supports SAP HANA as DBMS.ABAP SQL is an abstract set of SQL commands implemented at ABAP level and integrated into the ABAP language. At runtime, ABAP SQL is translated into a variant of SQL that the database understands. This variant is called Native SQL to distinguish it from ABAP SQL, the SQL variant that is integrated into ABAP. The translation from ABAP SQL to Native SQL takes place in the database interface, a component of the ABAP system that consists of a general part and a database-specific library.
Even though newer ABAP releases only support SAP HANA as DBMS, SAP has still retained the concept of ABAP SQL and the database interface. This is because of the following reasons:
- Architecture compatibility
- ABAP SQL and the database interface are an integral part of the system architecture.
- Code compatibility
- ABAP SQL coding from previous SAP products (including customer-specific development) should run free of side-effects in the modern, SAP-HANA-only ABAP environments.
- Tasks of the Database Interface
- The database interface does not just translate statements; it is also responsible for ABAP specific tasks like, for example, automatic client-handling.