Ansicht
Dokumentation
ABENNEWS-773-ABAP_SQL - NEWS-773-ABAP SQL
ROGBILLS - Synchronize billing plans Vendor Master (General Section)This documentation is copyright by SAP AG.
in Release 7.73
Open SQL Renamed as
The existing name Open SQL was changed to
. This renaming
reflects that some parts of now only support certain database platforms, specifically SAP HANA database, and hence that it is no longer fully platform-independent.
Access to Hierarchy Data
In queries, both
- hierarchies and
can be specified as data sources. Accessing hierarchy data triggers the strict mode from Release .
Secondary Connections
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 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.
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 implicit client handling. Before Release , 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 DDIC table 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 DDIC view filled by the INSERT statement enables strict mode from Release .
Subquery as Data Source of MODIFY
In the write statement MODIFY, a
parenthesized subquery SELECT subquery_clauses
can now be specified as a data source after FROM. The rows of the result 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 .
USING CLIENT and Session Variable client
In an read in which multiple queries access client-dependent
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.
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 grouping sets under one GROUP BY clause. This is the same as specifying UNION ALL with different GROUP BY clauses. The addition GROUPING SETS has an advantage over a UNION clause grouping because the SELECT clause only needs to be specified once.
Using GROUPING SETS triggers strict mode from Release .
Aggregate Function GROUPING
The aggregate function GROUPING
can now be used in a SELECT statement. The grouping function GROUPING can be used to verify whether a specific column is part of the
aggregation.
The grouping function can be used only if the GROUP
BY clause contains the addition GROUPING SETS.
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.
- When a view is accessed, its key fields must be located together at the start.
- The additions USING CLIENT and CLIENT SPECIFIED cannot be used when a CDS entity is accessed that is linked with a CDS role.
- Even when using path expressions, the addition CLIENT SPECIFIED can only be used for client-dependent data sources.
- When a column is specified, the actual names of the components must be used for a database table containing an include structure, and not the names of any groups defined in ABAP Dictionary.
- An alias name of the SELECT list defined using AS can have a maximum of 30 characters. Alias names with more than 30 characters are also not allowed after ORDER BY.
- Columns of the types LCHR and LRAW can be read in a query only if they are read together with the associated length fields.
- The following applies when using FOR ALL ENTRIES in the SELECT statement:
- The decimal places in the comparisons between columns of a data source and columns of the internal table of type p must match.
- All columns of the primary key specified after ORDER BY using PRIMARY KEY must also occur in the SELECT list.
- The pseudo component table_line can be specified only for internal tables with an elementary row type.
- A GROUP BY grouping must be applied to columns specified after HAVING outside aggregate functions. The same applies to columns specified directly in the SELECT list when a HAVING clause is specified, but that are not specified after GROUP BY.
- If a SELECT list is specified as *, a HAVING clause can only be used together with a GROUP BY clause.
- If an alias name is used after ORDER BY, this name must be unique and cannot be the same name as a column that does not have an alias name.
- A work area wa specified in the INTO clause has fewer components than explicit columns in the SELECT list.
- A column specified explicitly in the SELECT list cannot be assigned to the associated component of a structured work area wa specified in the INTO clause or to a data object dobj specified in a parenthesized comma-separated list.
- No character literals or constants can be specified on the right side of LIKE that are more than twice as long as the left side.
- The statements UPDATE FROM or MODIFY FROM are used to access a DDIC projection view in which all fields are key fields.
- A reference that is too general is specified in the statements INSERT FROM, UPDATE FROM, or MODIFY FROM when a writer stream is created.
- In the statement UPDATE, a column can occur only on the left side of a single update expression.
ABAP Short Reference PERFORM Short Reference
This documentation is copyright by SAP AG.
Length: 14184 Date: 20240329 Time: 111653 sap01-206 ( 206 ms )