Ansicht
Dokumentation

ABENINSERT_FROM_SELECT_ABEXA - INSERT FROM SELECT ABEXA

ABENINSERT_FROM_SELECT_ABEXA - INSERT FROM SELECT ABEXA

General Material Data   PERFORM Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

INSERT, FROM SELECT

This example demonstrates the statement INSERT with the addition FROM SELECT.

Source Code

Execute

Description

The DDIC database table DEMO_SUMDIST_AGG is filled with aggregated data from the tables SCARR and SPFLI.

  • First, a standalone SELECT statement is used to read the aggregated data into an internal table and then the statement INSERT is used to write it to the DDIC database table. This requires two database reads and the transport of the data between the database server and the AS ABAP.
  • The same SELECT statement is then used directly as a subquery in the INSERT statement. Only a single database read and no transport of data between the database server and the AS ABAP is then required.

The result of both INSERT statements is the same. DEMO_SUMDIST_AGG is a global temporary table (GTT), which means that its content must be deleted before the results are produced, since this creates an implicit database commit.






CL_GUI_FRONTEND_SERVICES - Frontend Services   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 1634 Date: 20240418 Time: 233041     sap01-206 ( 24 ms )