AS ABAP Release 758, ©Copyright 2024 SAP SE. All rights reserved.
ABAP - Keyword Documentation → ABAP - ABAP Release News → News for ABAP Release 7.40 and its SPs → News for ABAP Release 7.40, SP08 →
ABAP SQL in ABAP Release 7.40, SP08
New Column dbtab~* Specified After SELECT
In the definition of the result set in the SELECT list of a SELECT statement, data_source~* can be specified as an element of the SELECT list from ABAP release 7.40, SP08 to include all columns of different database tables or views used after FROM in the result set. If specified, data_source~* can be combined with individual specified columns col_spec (with the exception of aggregate expressions).
When data_source~* is specified in the result set, the syntax check is performed in a
strict mode, which handles the statement more strictly than the regular syntax check.
Inline Declarations for the Target Area of SELECT
After the addition INTO of a SELECT statement, inline declarations can be made from ABAP release 7.40, SP08 using the declaration operator DATA(...) with the prefixed escape character @. Inline declarations can be made for individual parenthesized data objects (@DATA(elem1),@DATA(elem2),...), for individual work areas INTO @DATA(wa), and for internal tables INTO TABLE @DATA(itab). Either an elementary data object, a structure, or an internal table is declared depending on the result set defined in the SELECT list and the database tables used after FROM.
When inline declarations are used, the syntax check is performed in a
strict mode, which handles the statement more strictly than the regular syntax check.
SQL Expressions
The SQL expressions introduced in ABAP release 7.40, SP05 were revised in the following ways:
If one of the new features is used, the syntax check is performed in a
strict mode, which handles the statement more strictly than the regular syntax check.
Reads on CDS Views with Parameters
From ABAP release 7.40, SP08, CDS views can be defined with input parameters that are assigned actual parameters when used. To enable this, the option of a parenthesized comma-separated list for parameter passing was added to the data source specified in the statement SELECT:
Since not all database systems support views with parameters, the new class CL_ABAP_DBFEATURES
with the method USE_FEATURES is available, which detects whether this
is possible for the current database system. Furthermore, accessing a view with parameters triggers a warning from the syntax check; this warning can be hidden by a pragma.
Restrictions Removed
The following previous restrictions were removed:
When one of the rule changes is exploited, the syntax check is performed in a
strict mode, which handles the statement more strictly than the regular syntax check.
Position of the INTO Clause
From ABAP release 7.40, SP08, the INTO clause can and should be specified as the final clause of a SELECT statement. In this case, the additions UP TO, OFFSET and abap_options of the SELECT statement must be specified after INTO.
If the INTO clause is specified as the final clause, the syntax check is performed in a
strict mode. This handles the statement more strictly than the regular syntax check.
Stricter Checks for Syntax Rules
From ABAP release 7.40, SP08, the following syntax constructs that have always contained errors now produce syntax errors or runtime errors.
Any columns that are specified in a HAVING
clause outside of an aggregate expression must also be specified after
GROUP BY. Before ABAP release 7.40, SP08, this was not recorded by the
static syntax check, but did raise a catchable exception. From ABAP release 7.40, SP08, this produces a syntax check warning and raises an uncatchable exception outside of the
strict mode of the syntax check.
Example
From ABAP release 7.40, SP08, a syntax warning and uncatchable exception for:
DATA itab TYPE TABLE OF scarr.
SELECT *
FROM scarr
INTO TABLE itab
HAVING carrid = 'LH'.
Strict Mode in the Syntax Check
If one the new features listed here is used in an ABAP SQL statement, the syntax check is performed in a
strict mode, which handles the statement more strictly than the regular syntax check.
Comparable Types
A table of comparable types was constructed for comparisons performed on the database. The results of comparisons made between non-comparable types are determined by the database system and produce a syntax error (in the strict mode of the syntax check) or a syntax warning.