SQL - Stuctured Query Language

When it comes to programming in the SAP environment, SQL is probably the most commonly used language after ABAP. The "Structured Query Language" is a database language that masters the definition of structures of a relational database as well as the editing and querying of the data sets on it.
SQL exists in various standardized versions. Based on this, almost every database masters further special commands. The resulting dialects make it difficult to migrate SQL code from one database to another.

SQL essentially consists of three areas:

  • the Data Definition Language (DDL), which is used to create and modify data structures (examples: CREATE TABLE, DROP TABLE),
  • the Data Manipulation Language (DML), which is used to process the data, i.e. read, write and delete (examples: SELECT, INSERT, UPDATE, DELETE),
  • the Data Control Language (DCL) used to manage access permissions (examples: GRANT, REVOKE).

Database access in SAP via SQL

The core of any SAP system is its database. In addition to the productive data, the programs required for using the system are also stored there. Therefore, it was and is important to be able to communicate with the database from within the system.

In BW and ERP systems without SAP HANA database, this communication usually happens very indirectly. The tasks of the DDL are taken over there by the ABAP Dictionary (transaction SE11), in which tables, structures and data elements are defined. This is done in the SAP GUI without the user seeing a line of SQL code. The DCL is superfluous because the SAP system brings its own authorization system for accessing data. Only by using the DML does one come into direct contact with SQL in such systems.


ABAP supports its own Open SQL, which offers less functionality than the dialect of a specific database, but provides a uniform interface to address a wide variety of databases. Thus, it prevents problems with the replacement of the underlying database and an associated change of the SQL dialect. Since the data is only to be read from the database anyway, then processed with the help of ABAP and written back again, Open SQL is not really a limitation.



Since the introduction of the SAP HANA database, SAP has pursued a different strategy: as many calculations, lookup and Join-operations should already take place in the database (keyword code Pushdown), thus benefiting from the advantages of the in-memory database. For this purpose, new tools are available on systems with SAP HANA database that enable direct access to the database using SQL.

So-called CDS views allow the mapping of extensive logics - implemented in SQL on database level. For this, the data does not have to be duplicated, everything happens on-the-fly. This makes a reporting possible that shows the current data stock and is not only updated after certain time intervals. In addition, "ABAP Managed Database Procedures"(AMDP) replace BW transformations and thus enable the acceleration of e.g. data loading processes by code Pushdown.


Systems with SAP HANA database only really show their qualities when they are challenged. Processes can be accelerated by moving existing ABAP logic to the database. Reporting with more direct access to the current data stock becomes more meaningful.

Your advantage

  • Lean data management
  • Faster loading processes
  • More direct reporting

Our offer

Our consultants and business intelligence teams have the experience and expertise to optimally apply the tools described. From conception to implementation, we are at your service. We create future-proof and robust solutions for the digitization of your business processes.