The Most Frequently Asked In-Depth Questions About SAP CDS Views

CDS Views

The list contains the most frequently asked in-depth questions about SAP CDS Views. The list grows continual. The answers are to the point. As a result, as short as possible without missing the important information.

Please leave a comment if the list does not contain your question. I will try to answer it and maybe add it to this list.

How to Consume an OData Service of a CDS View with Parameters Including a Date Value?

ABAP CDS View with parameters bp_id, p_date and p_language:

@AbapCatalog.sqlViewName: 'ZC_CDSView'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'My Consumption CDS View'
@OData.publish: true
define view ZC_CDS_View_Consumption
    with parameters bp_id: bu_partner,
        @Environment.systemField: #SYSTEM_DATE
        p_date: dats,
        @Environment.systemField: #SYSTEM_LANGUAGE
        p_langu: spras
as select from ZI_CDS_View_Composite {    
    
    key partner1, 
    partner2, 
    date_to, 
    reltyp, 
    date_from, 
    spras, 
    bez50, 
    bez50_2
    
} where partner1 = :bp_id
    and date_to >= :p_date
    and date_from <= :p_date
    and spras = :p_langu

OData Service consumption of the from the ABAP CDS View generated OData Service with parameters:

/sap/opu/odata/sap/ZCDS_VIEW_SRV/ZC_CDS_View_Consumption(bp_id='0123456789',p_date=datetime'2019-04-01T12:00',p_langu='E')/Set
No Comments

FREE SAP Modules Overview! (Complete)

Plus, receive all future infographics and SAP tips & insights that are only shared with the private newsletter subscribers. 

Latest Poll
Essential Ressources

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.

Menu