ABAP CDS - SELECT
SELECT [DISTINCT] { select_list
FROM data_source
[association1 association2 ...] }
| { FROM data_source
[association1 association2 ...]
{select_list} }
[clauses]
Effect
The SELECT statement defines a query performed on the data sources specified in data_source for a CDS view in ABAP CDS. Possible data sources are database tables defined in ABAP Dictionary, classic views, or other CDS views.
The optional additions clauses are SELECT clauses that enable conditions, groupings and union sets to be specified or created.
Example
The CDS view business_partner_role defined here is a view of an existing CDS view, business_partner. An element bp_role is defined in the SELECT list and given the comment Business partner role. Any duplicate values of the element are removed using DISTINCT.
The addition of DISTINCT of SELECT is no longer needed in this case.
FROM data_source
[association1 association2 ...] }
| { FROM data_source
[association1 association2 ...]
{select_list} }
[clauses]
Effect
The SELECT statement defines a query performed on the data sources specified in data_source for a CDS view in ABAP CDS. Possible data sources are database tables defined in ABAP Dictionary, classic views, or other CDS views.
- select_list defines the components read in a list.
- association1, association2, ... define associations for the current SELECT statement. These associations can be accessed in data_source and in select_list using path expressions.
- DISTINCT removes duplicates from the results list.
The optional additions clauses are SELECT clauses that enable conditions, groupings and union sets to be specified or created.
Example
The CDS view business_partner_role defined here is a view of an existing CDS view, business_partner. An element bp_role is defined in the SELECT list and given the comment Business partner role. Any duplicate values of the element are removed using DISTINCT.
- @AbapCatalog.sqlViewName: 'BPA_ROLE_VW'
define view business_partner_role as
select distinct
from business_partner
{ business_partner.role //Business partner role
}
- SELECT * FROM business_partner_role INTO TABLE tab ...
The addition of DISTINCT of SELECT is no longer needed in this case.
********************************ROHINI KUMAR*********************************
Please support my work : sap.rohini988@gmail.com LinkedIn Link : https://www.linkedin.com/in/rohini-kumar-14647a13a/
********************************************************************************
Comments
Post a Comment