SAP NetWeaver AS ABAP Release 751, ©Copyright 2017 SAP AG. All rights reserved.
ABAP - Keyword Documentation → ABAP - Reference → Processing External Data → ABAP Database Accesses → Open SQL → Open SQL - Reads → SELECT clauses → SELECT - WHERE → WHERE - sql_cond →sql_cond - subquery_clauses
Syntax
... { FROM source
FIELDS select_clause }
| { select_clause
FROM source }
[WHERE sql_cond]
[
GROUP BY group] [HAVING group_cond]
[db_hints] ...
Effect
Possible clauses and additions of a subquery in a condition sql_cond in Open SQL.
The addition USING CLIENT must not be specified n the FROM clause. The automatic client handling of the subquery is performed in accordance with the client handling of the outer statement. If specified, an addition USING CLIENT of the outer statement also applies to the subquery.
A subquery can be used within the following relational expressions sql_cond for a subquery:
Conditions of a subquery can themselves contain subqueries. In nested subqueries, the columns specified in the WHERE conditions are searched inside out, though the columns of inner subqueries conceal columns with the same name in outer subqueries.
Only a limited number of SELECT statements can be used as subqueries in an Open SQL statement. The maximum number is defined so that the Open SQL statement can be executed on all supported database systems. If statically identifiable, more than 50 SELECT statements produce a syntax error or a runtime error. This restriction is independent of whether the subqueries are nested or occur in different relational expressions of the WHERE condition.
Notes