Ansicht
Dokumentation
ABENHANA_CACHED_VIEWS - HANA CACHED VIEWS
ROGBILLS - Synchronize billing plans RFUMSV00 - Advance Return for Tax on Sales/PurchasesThis documentation is copyright by SAP AG.
Cached Views in SAP HANA
The SAP HANA database supports the concept of cached views. Under certain circumstances, the results of reads of a view can be cached in a cache to avoid repeated aggregation. For more information, see the SAP HANA documentation.
Caching can also be used for such views in read statements. The following conditions must be met:
- The type of a view known in (DDIC database view in the ABAP Dictionary or CDS view) must be defined for the caching. Here, the SQL statement ALTER TABLE (described in the documentation for HANA-specific SQL) can be used with the addition ADD CACHE. ABAP Dictionary employs the dynamic cache concept.
- The use of the cache must be activated in the query by using the database hint %_HINTS HDB 'RESULT_CACHE'.
- The query must have aggregate expressions and a GROUP BY clause.
If these prerequisites are met and a suitable cache exists, queries of the same type read from the cache. To find out whether a cache was used, how old its data is, and the maximum lifetime of the data in the cache, the addition EXTENDED RESULT of the INTO clause can be used to provide the result object with the corresponding information. To do this, the value abap_true must be passed to the parameter IV_CACHED_VIEW of the instance constructor of the class CL_OSQL_EXTENDED_RESULT when the object is created. The methods for reading the relevant values start with the prefix CVIEW_.
Note
For cached views, an alternative for handling the exception CX_OSQL_EXTENDED_RESULT is to execute the method CVIEW_VALID for the result object of EXTENDED RESULT to determine the validity of the extended result.
Example
ROGBILLS - Synchronize billing plans PERFORM Short Reference
This documentation is copyright by SAP AG.
Length: 3375 Date: 20240328 Time: 200819 sap01-206 ( 34 ms )