2

When annotating an input parameter to a CDS view, which is consumed via oData in a Fiori Elements List Report App, I tried using the @Consumption.dervivation annotation to preset a parameter with a value derived from another entity.

define view zi_ptdata_missing
  with parameters
    @EndUserText.label: 'JahrMonat'
    @Consumption.derivation: { lookupEntity: 'I_CalendarDate', 
                               resultElement: 'YearMonth',
                               binding: [{ targetElement: 'CalendarDate', 
                                           type: #CONSTANT, 
                                           value: '20200101' }] }
    YearMonth : vdm_yearmonth
  as select from    I_CalendarDate
    left outer join ...
{
      ...
}
where
       I_CalendarDate.YearMonth = :YearMonth
  and  ...

My goal is to preset the input field with the current year-month in the form YYYYMM. Since this is not working I suspect this might be dependent on the frontend, through which the CDS view is consumed and might not even be supported in Fiori Elements.

Is there an overview for which frontends support the @Consumpion.derviation annotation for input paramenters?

I tried specifying the @Consumption.derivation without a binding, binding to elements using the value #SYSTEM_DATE and a fixed date like in the provided example. I was expecting to have the input field in the Fiori Elements app filled on page load. Instead it remains empty and prompts me to provide a value.

  • I have no great suggestions but noticed that the documentation mentions: `An element can be annotated with Consumption.derivation only if for this element Consumption.filter is present. The derivation is then used to determine the filter value. An empty derivation of a hidden and mandatory parameter/filter will cause a runtime error.`. Did you include a filter? – Jorg Feb 09 '23 at 00:31

0 Answers0