Skip to content

ABAP Keyword Documentation →  ABAP Dictionary →  ABAP CDS in ABAP Dictionary →  ABAP CDS - Views 

ABAP CDS - Data Aging

The data aging concept makes it possible to distinguish between current, "HOT", data and old, "COLD"), data in a database system. Application programmers define which data is hot or cold in a special temperature column in a database table. The entries in this column partition the data in the database table and makes it possible to archive obsolete data in a transparent way for application programmers. The application programmers decide whether they only want to read current data or obsolete data too. In most cases, applications only want to read current data and this is the default setting for CDS views.

If all data is to be read using a CDS view, the default behavior can be overridden using the annotation @DataAging.noAgingRestriction: 'true'.

Other versions: 7.31 | 7.40 | 7.54


Example

When the CDS view sales_order_12 is accessed, only data flagged as "HOT" in the database table snwd_so is read.

@AbapCatalog.sqlViewName: 'SALES_ORDER_2012'
@DataAging.noAgingRestriction: 'false'
define view sales_order_2012 as
  select from snwd_so
         { key snwd_so.so_id,
               snwd_so.buyer_guid as customer_guid }
  where snwd_so.created_at >= 20120101000000.0
    and snwd_so.created_at < 20130101000000.0;