SAP SELECT UNION SUM GTT ABEXA



Get Example source ABAP code based on a different SAP table
  



SELECT, Union with Global Temporary Table
This example demonstrates a union across a table and a global temporary table (GTT).

ABAP_SOURCE_CODE
DEMO CL_DEMO_SELECT_UNION_SUM_GTT

ABAP_DESCRIPTION
This example has the same result as the executable example for a union with aggregate expression. Here, however, the SELECT statement is split into two AB-SQL statements for demonstration purposes:
The aggregation is performed in the subquery of an INSERT statement whose result set is written to a global temporary table (GTT).
UNION is used to create the union of the result set of a SELECT statement on the table SFLIGHT and a SELECT statement on the GTT.
The GTT must be cleared explicitly before the end of the execution to prevent the runtime error COMMIT_GTT_ERROR in the next implicit database commit.



Latest notes:

See also the corresponding executable example for common table expressions.
NON_V5_HINTS
ABAP_HINT_END