Get Example source ABAP code based on a different SAP table
ABAP_DDIC - Global Temporary Tables Global temporary tables (GTTs) are a special kind of transparent tables> intended for storing temporary data. This data exists only within a database LUW> and can be accessed only by a consumer. GTTs are used to store temporary interim results to split complicated database processes into multiple steps. GTTs are designed for this purpose only and hence incur far lower administration costs than regular transparent tables. The GTT concept specifies that a GTT is always empty at the start of a database LUW and hence always must be cleared at the end of each database LUW. Most database systems provide native support for this concept by implicitly defining data in a GTT database table as transaction-specific data. This data is deleted automatically at the end of a database LUW, that means, during a database commit > or database rollback>. In ABAP Dictionary, the table category> global temporary table> can be specified for a DDIC database table. Tables in this category are created as a GTT in the database. The following additional rules apply in AB_SQL > access to GTTs to avoid platform-dependent behavior and unexpected responses when handling GTTs:
If an ABAP Dictionary GTT was filled by a modifying AB-SQL statement, it must be cleared explicitly before the end of the current database LUW>. The following can be used here:
The AB-SQL statement DELETE FROM dbtab> > without specifying a WHERE> condition.
All explicit database commits> and database rollbacks>, such as the AB-SQL statements COMMIT WORK>>, COMMIT CONNECTION>>, ROLLBACK WORK>>, ROLLBACK CONNECTION>> BEGIN_SECTION VERSION 5 OUT and all associated Native SQL> statements and calls. END_SECTION VERSION 5 OUT
If an ABAP Dictionary GTT filled using AB_SQL was not cleared explicitly using one of these methods before an implicit database commit>, the runtime error COMMIT_GTT_ERROR> occurs independently of its content. BEGIN_SECTION VERSION 5 OUT
The obsolete addition CLIENT SPECIFIED> is forbidden. This includes the use of CLIENT SPECIFIED >> in queries and the use of CLIENT SPECIFIED>> in UPDATE SET> and DELETE FROM>. The non-obsolete form> of CLIENT SPECIFIED> in write statements is allowed. END_SECTION VERSION 5 OUT Besides these rules, GTTs can be used like regular transparent tables. Regarding their definition in ABAP Dictionary, the following settings are predefined and cannot be modified: