eclipseannotationsabapcds

Is there a CDS view annotation (ABAP) to remove/select a field?


I created an ABAP CDS view from a dataset. This dataset contains data with a field "OrderID" (from order 1 to order 10000). Based on this field, OrderID, I would like to create 2 query views : one containing only data from order 1 to 20 and another one with order 50 to 70.

Therefore, I was wondering if there is an annotation to select the value I want to show/remove. I don't want to filter for performance reason.


Solution

  • Use a where clause, as described in the ABAP keyword documentation:

    define view first_query_view as
      select from your_base_view
        { ... }
        where OrderID between 1 and 20;
    
    define view second_query_view as
      select from your_base_view
        { ... }
        where OrderID between 50 and 70;
    

    Annotations explain how views and the elements in them are to be used. They don't control how the data is retrieved, joined, or filtered.