SAP SELECT EXCEPT MIN GTT ABEXA Get Example source ABAP code based on a different SAP table
SAP Help
SELECT>, Difference with Global Temporary Table This example demonstrates a difference across a table and a global temporary table (GTT).
ABAP_SOURCE_CODE DEMO CL_DEMO_SELECT_EXCEPT_MIN_GTT
ABAP_DESCRIPTION This example has the same result as the executable example for a
difference 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)>. EXCEPT>> is used to create the difference 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.