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