ABAP - Keyword Documentation →  ABAP - Release-Specific Changes →  Changes in Release 7.40 and Its SPs →  Changes in Release 7.40, SP02 → 

Open SQL in Release 7.40, SP02


1. Optimized table buffering


2. Result type of the aggregate function COUNT( * )


3. Decimal places in the INTO clause


4. Conditions in outer joins


5. Enhancements for sorting by primary key


6. Handling strings


7. Field symbols and data reference variables in SELECT loops


8. Specifying dynamic tokens


9. Stricter checks for syntax rules



Modification 1

Optimized Table Buffering

Modification 2

Result Type of the Aggregate Function COUNT( * )

In cases where the aggregate function COUNT( * ) or COUNT(*) is specified as the only element in the SELECT list and without a GROUP BY clause, INT8 was added to the internal data type of the result. If the value range is to be used in full, a target object with the data type p or decfloat34 must be used after INTO. The system field sy-dbcnt is set to the value -1 in events outside its value range.



Modification 3

Decimal Places in the INTO Clause

The assignment rules of the INTO clause of the statement SELECT were modified so that surplus decimal places are now always cut off when numbers are assigned to target fields with too few decimal places. Until now, it was possible to round the numbers (depending on the database and table buffering).



Modification 4

Conditions in Outer Joins

The restriction in previous versions, which meant that only equality comparisons (=, EQ) were possible in the ON condition of outer joins, no longer applies.



Modification 5

Enhancements for Sorting by Primary Key

If the addition PRIMARY KEY is used after ORDER BY, the following restrictions no longer apply:

Modification 6

Handling Strings

The following (previously undocumented) restrictions have been lifted:

Modification 7

Field Symbols and Data Reference Variables in SELECT Loops

When field symbols or dereferenced reference variables are specified for the work area, individual data objects, or internal tables in a SELECT loop after INTO, the data object that is the target of a field symbol or reference variable is identified precisely once, from Release 7.40, SP02, when the loop is entered. This data object is used as a target area in each loop pass. Any modifications to the assignment of a field symbol or reference variable within the loop are ignored. From Release 7.40, SP02, the assignment of a field symbol or reference variable is determined again for each loop pass and the current data object is used as the target area.



Modification 8

Specifying dynamic tokens

With Release 7.40 SP02 and higher, internal tables, which are specified as dynamic tokens of statement SELECT, can also have secondary keys.



Modification 9

Stricter Checks on Syntax Rules

In Release 7.40 SP02, a new SQL parser was introduced for Open SQL. These parser performs stricter checks on some rules than the old parser. More specifically, the same parser is now used for statically specified Open SQL and for the content of dynamic tokens. In Release 7.40, SP02, this parser will initially only be used for the statement SELECT. One consequence of this is that any following syntax constructs that have always contained errors now produce syntax errors or runtime errors.