Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Processing External Data →  ABAP Database Access →  ABAP SQL →  ABAP SQL - Overview →  ABAP SQL - Table Buffering 

Table Buffering - Restrictions

Only transparent tables can be buffered. Global temporary tables cannot be buffered. There is no special restriction on the key length of the table when buffering, which means that keys in buffered tables can be up to 900 bytes long. The table buffer is not used on principle in the case of database reads using Native SQL and AMDP.

Any writes access the data in the database table directly and entail asynchronous buffer synchronization. After the invalidation of an entry in the buffer using a write statement, the next five reads that should have accessed the entry bypass the buffer of the current AS Instance by default. The next read performed on the changed entry reloads it into the buffer and removes the invalidation. The number of reads that bypass the buffer before the reload is specified in the profile parameter zcsa/sync_reload_c.

The fact that certain operations can only be performed on the database and not in the table buffer produces the further restrictions for reads listed below. If these restrictions are not respected, read ABAP SQL statements bypass the table buffer implicitly and access the database tables or views directly.

  • The following reads always bypass the table buffer:
  • The ABAP SQL language element UNION.
  • No JOIN expressions can be specified.
  • The GROUP BY clause cannot be used. This also excludes the HAVING clause.
  • The ORDER BY clause cannot be used in cases where single columns are specified as sort keys and these columns are not a left-aligned subset of the primary key (in the correct order) or if the addition DESCENDING is specified in a column.
  • When a table or view with single record buffering is accessed, all key fields of the primary key must be specified using equality conditions joined using AND.
  • When a generically buffered area is accessed, it must be specified in full using equality conditions joined using AND.
  • Only host variables or host expressions can be used on the right side of a relational expression used to identify a single record or a generically buffered area. In any other relational expressions of a condition, columns too can be specified in comparisons or when BETWEEN is used. This applies in cases where neither (numeric) operand has the type DF16_DEC or DF34_DEC, both operands are character-like, or both operands have the type RAW with the same length.
  • No column can be compared with another column in a data source specified after FROM.
  • If FOR ALL ENTRIES is used when accessing a table or view with generic buffering, the generic area must be specified exactly and multiple generic areas cannot be joined using OR.
  • The variant of the operator IN with an operand list on the left side cannot be used.

Other versions: 7.31 | 7.40 | 7.54


Notes

  • For performance reasons, the fact that the table buffer is bypassed when these restrictions are not met should always be remembered when accessing buffered database tables or views.

  • To bypass the table buffer in the statement SELECT explicitly, the addition BYPASSING BUFFER should always be used. It is not enough to rely on the implicit behavior itself.

  • In cases where an internal table is used as a data source of a query, the read restrictions also determine whether the table can be evaluated on the AS ABAP or whether its content needs to be transported to the database.