SAP OPEN CURSOR MAINQUERY ABAP Statements



Get Example source ABAP code based on a different SAP table
  



OPEN CURSOR, mainquery_clauses

ABAP_SYNTAX
... ${ FROM source
FIELDS select_clause $}
$| ${ select_clause
FROM source $}
$[$[FOR ALL ENTRIES IN itab$]
WHERE sql_cond$]
$[GROUP BY group$] $[ HAVING group_cond$]
$[ORDER BY sort_key$]
$[db_hints$] ...

What does it do?
Possible clauses and additions of the main query after OPEN CURSOR. All the same clauses are possible as for a standalone SELECT statement except for SINGLE. The clauses define the result set, which can be accessed using the FETCH statement. The result set is regarded as having multiple rows.
The addition FOR ALL ENTRIES cannot be used if common table expressions are defined using WITH.



Example ABAP Coding

OPEN CURSOR statement with all possible clauses.
ABEXA 00458
ABAP_EXAMPLE_END

Return to menu