AS ABAP Release 753, ©Copyright 2019 SAP AG. All rights reserved.ABAP Keyword Documentation → ABAP - Release-Specific Changes → Changes in Releases 7.5x → Changes in Release 7.53 →
ABAP SQL in Release 7.53
Open SQL Renamed as ABAP SQL
The existing name Open SQL has been changed to
ABAP SQL. This renaming reflects
that some parts of ABAP SQL now only support certain database platforms, specifically SAP HANA database, and hence that it is no longer fully platform-independent.
On an AS ABAP with a SAP HANA database as its standard database, only those secondary connections should be used from the database table DBCON whose secondary database is also a SAP HANA database. Alongside the CONNECTION addition in , this also applies to ABAP SQL and Native SQL (ADBC and EXEC SQL).
SAP HANA Smart Data Access (SDA) should be used instead. In SDA, secondary
databases are addressed from the SAP HANA database using special qualified names or by using virtual
tables. If a SAP HANA database is used as a standard AS ABAP database, ABAP programs can use these names
across the standard connection. This is only possible in AMDP and Native SQL. Database Shared Libraries (DBSL) are no longer required here.
Relational Expression IS INITIAL
When used, this expression requires the strict mode from Release 7.53.
ABAP SQL now supports the following new date/time functions:
Publishing Associations of Common Table Expressions
When CDS views are accessed within a common table expression, the addition WITH ASSOCIATIONS of the statement WITH can now be used to publish associations of these views for use in path expressions of the current WITH statement. The addition REDIRECT TO can also be used to replace the target data source of the published association with a previous CTE or the current CTE.
When used, this addition requires the strict mode from Release 7.53.
Number Literals in the SELECT List
Until now, only those
numeric literals whose value matched the value range of the type
INT4 could be specified as elementary SQL expressions
in the SELECT list of a query. Now numeric literals of up to 31 digits can be specified, which are interpreted as numbers of the type
DEC if the value range of INT4 is exceeded.
Enhanced Cast Matrix
A cast expression can now be used to convert the data types INT1, INT2, INT4, and INT8 to DEC.
Client Handling in Subquery of the Statement INSERT
The addition USING CLIENT of the statement INSERT can now be specified in a subquery. This means that the client specified for the target table of the insert operation can be different from the client specified for the data source of the subquery.
If USING CLIENT is not specified in the subquery, the current client ID is now always applied to automatic client handling. Before Release 7.53, the client ID specified after INSERT using USING CLIENT was also used in the subquery.
The FROM clause of the subquery can now access the database table or classic view filled using the INSERT statement. This makes it possible to copy the data from one client to another.
In the subquery, using USING CLIENT or accessing the database table or classic view filled by the INSERT statement enables
strict mode from Release 7.53.
Subquery as Data Source of MODIFY
In the ABAP SQL write statement MODIFY,
a parenthesized subquery SELECT subquery_clauses
can now be specified as a data source after FROM. The rows of the results
set of the subquery are modified or inserted in the target table directly on the database. No data transport is required between the database and AS ABAP. When used in MODIFY, a subquery demands
strict mode from Release 7.53.
USING CLIENT and Session Variable client
In an ABAP SQL read in which multiple queries access client-specific
CDS views and the client handling
method is defined using the annotation @ClientHandling.algorithm:#SESSION_VARIABLE, the
session variable client (which corresponds to the
ABAP-specific session variable CDS_CLIENT
on the SAP HANA database) must be set to the same value in all of these queries. The runtime error SAPSQL_DIFFERENT_CLIENT_VALUES
occurs if USING CLIENT is
used to specify a different client ID in one of these queries. This situation can occur in the statement
WITH or when using UNION.
Null Values in the Table Buffer
The table buffer now supports real null values. In table buffering, null values are no longer transformed to type-dependent initial values. When the buffer is accessed, the same results are produced as when the database is accessed directly. The corresponding restrictions now no longer apply. The following are some of the aspects affected:
ABAP SQL statements that exploit a database property not supported by all database platforms no longer produce a syntax check warning and produce a syntax warning in the
extended program checks instead.
If the data of the internal table needs to be transported to the database in cases where the internal table is used as a
data source of the ABAP SQL statement
SELECT, a syntax check warning occurs that can be hidden using the pragma ##itab_db_select.
Replacement Service in Program Calls
The method ACTIVATE_REPLACEMENT of the class CL_OSQL_REPLACE
has the new parameter FLG_SURVIVE_SUBMIT, which now also permits redirections in called programs.
GROUP BY Addition GROUPING SETS
In a SELECT statement, the
GROUP BY addition
GROUPING SETS can now be used. The addition GROUPING SETS makes
it possible to group multiple aggregations under one SELECT
statement. This can also be done by specifying the same SELECT statement
with different GROUP BY clauses and using the addition
UNION to group them in a single statement. This approach is more work,
however, is error prone and is harder for the database to optimize. The addition GROUPING
SETS also makes it easier to interpret and maintain the SELECT statement.
Aggregate Function GROUPING
The aggregate function
GROUPING can now be used in a SELECT statement. An
aggregate expression with the
aggregate function GROUPING acts as a grouping function for
GROUPING SETS in a
GROUP BY clause. The grouping function GROUPING makes it possible
to identify whether a specific column in the results set in question was aggregated or not. A grouping
function can be used only if the GROUP BY clause contains a GROUPING SETS addition.
Stricter Checks on Syntax Rules
A violation of the following rules now always produces a syntax error. In the strict modes of the syntax check, these violations already produced a syntax error. Outside the strict modes, they produced a syntax check warning and in most cases a runtime error when the program was executed.