Get Example source ABAP code based on a different SAP table
AB_SQL - Table Buffering Table buffering> buffers data from the database in a table buffer > in the shared memory> of the current ABAP_ASINSTANCE . Table buffering is possible for the following objects and takes place when they are accessed using AB_SQL :
DDIC database tables> For more information, see DDIC - Table Buffering of Database Tables>.
DDIC database views> defined in the ABAP Dictionary For more information, see DDIC - Database Views>.
CDS view entities> defined in ABAP CDS> For more information., see ABAP CDS - Table Buffering of CDS View Entities>.
ABAP_CDS_V1_VIEWS > defined in ABAP CDS> For more information., see ABAP CDS - Table Buffering of CDS DDIC-Based Views>. The definitions determine whether and how a DDIC database table, DDIC database view or CDS view entity is buffered. Using buffering generally improves performance (by factors of between 50 and 500), since the data does not need to be transported between the AS ABAP and the database server each time and because process changes can be prevented. When a DDIC or CDS object for which table buffering is defined is accessed using AB_SQL , table buffering > is active by default. Table buffering is performed by the database interface> when buffered tables or views are accessed using AB-SQL statements. If a program uses AB_SQL to read> data in a buffered table or view, the table or view is accessed using the table buffer, with some exceptions>. To do this, the database interface determines whether this data is in the table buffer of the current ABAP_ASINSTANCE . If this is the case, the data is read directly from the buffer. If the data is not contained in the buffer of the ABAP_ASINSTANCE , the data is read from the database and loaded into the buffer. This means the data can accessed from the buffer next time. Writes> cause asynchronous buffer synchronization>. The buffering type> defines which records are loaded into the buffer when it is accessed. There are also, however, variants of AB-SQL statements that cannot be executed using the table buffer and which therefore bypass> table buffering. BEGIN_SECTION VERSION 5 OUT Native SQL> access or END_SECTION VERSION 5 OUT AMDP methods> are applied to the database directly and therefore always bypass table buffering.
Buffering type>
Buffer synchronization>
Buffer management>
Restrictions>
SQL expressions>
Latest notes:
Typical candidates for buffering are customizing tables and system tables. In certain cases, customizing-like tables with master data can also be buffered. If it is vital that current data is accessed from a buffered table, the addition BYPASSING BUFFER>> of the statement SELECT> can be used. If this addition is used a lot, the table should be checked for its suitability for buffering or whether the current data is really always required.