SAP BUFFER GENERIC BUFFERING



Get Example source ABAP code based on a different SAP table
  



ABAP_BUFFER - Generic Buffering
When a read is performed on a row, all rows are loaded into the table buffer that match this row in a left-aligned part of the primary key. The number of respected key fields is specified in the definition and is always less than the total number of key fields. These key fields form the generic key.
The individual generic areas are handled like standalone tables or views whose primary key is the generic key and that are fully buffered.
If a fully specified generic key is used to access an unbuffered row through AB_SQL , an attempt is made to load the area. If the row is not found, this is noted in the buffer and the database is not accessed again the next time a row is accessed using a fully specified generic key.



Latest notes:

In a generically buffered table or view, access to nonexistent data is very fast (see Buffer Management).
When using generic buffering, any AB-SQL statements must respect the generic key to prevent them from bypassing table buffering.
Generic buffering should be used if usually only certain areas of the table or view are required. These areas should not be too small, to prevent too many of them from being created and overloading buffer management. They should also not be too big, to prevent too much data from being loaded. Full buffering may also be more efficient in some cases. Accordingly, the generic key must not cover too many or too few fields.
NON_V5_HINTS
ABAP_HINT_END

ABAP_EXAMPLE_VX5
One good application of generic buffering is language-dependent data that has the language code field as a generic key.
ABAP_EXAMPLE_END