Ansicht
Dokumentation

ABENCDS_SELECT_STATEMENT_V2 - CDS SELECT STATEMENT V2

ABENCDS_SELECT_STATEMENT_V2 - CDS SELECT STATEMENT V2

rdisp/max_wprun_time - Maximum work process run time   Vendor Master (General Section)  
This documentation is copyright by SAP AG.
SAP E-Book

- CDS View Entity, SELECT

SELECT $[DISTINCT$] FROM data_source
       $[association1 association2 ...$]
           {select_list}
       $[clauses$]


Effect

In a CDS view entity, as part of the statement DEFINE VIEW ENTITY, a SELECT statement defines a query performed on the data sources specified in data_source. Possible data sources are DDIC database tables, CDS view entities, CDS table functions, CDS hierarchies, or .

  • DISTINCT removes duplicates from the result set. If DISTINCT is specified, the elements cannot have the type LCHR, LRAW, STRING, RAWSTRING, or GEOM_EWKB.
  • The select_list defines the components read in a list.
  • The optional addition clauses are SELECT clauses that enable conditions, groupings, or set operators.

Note

  • The syntax SELECT * to select all elements from the data source is not supported in CDS view entities. This syntax can be used in and in , but not in CDS view entities.

Example

The CDS view entity DEMO_CDS_BUPA_NAME shown below is based on the existing DEMO_SALES_CDS_BUPA. In the SELECT list, the element family_name is defined, assigned the alias name last_name, and given the comment Business partner last name.

The CDS view entity DEMO_CDS_BUPA_NAME can be addressed in ABAP programs using , for example:

SELECT * FROM demo_cds_bupa_name INTO TABLE @itab ...

Example

The following CDS view entity removes any duplicate values of the result set using DISTINCT.

The program DEMO_CDS_DISTINCT first fills the underlying database table and then accesses the view using SELECT. One duplicate entry is removed from the result set.

The addition DISTINCT of SELECT is no longer needed in this case.






Fill RESBD Structure from EBP Component Structure   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 5856 Date: 20240426 Time: 232017     sap01-206 ( 74 ms )