Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP CDS Consumption.derivation error Default cannot be determined (depends on user input)

MateuszTrojanow
Explorer
1,942

Hi,

While trying to utilise the functionality of Consumption.derivation I have encountered the following error:

Here’s my MAIN_VIEW with consumption derivation for parameter p_fromDate which should look up for a value in the view SUPPORTING_VIEW using binding value based on parameter p_startDate defined in the MAIN_VIEW.

define view MAIN_VIEW with parameters
@AnalyticsDetails.query.variableSequence: 1
p_startDate: abap.dats,
@AnalyticsDetails.query.variableSequence: 2
@Consumption.derivation: {lookupEntity: 'SUPPORTING_VIEW', resultElement: 'fromDate', binding: [{targetParameter: 'p_startCalculationDate', type: #PARAMETER, value: 'p_startDate' }]}
p_fromDate: abap.dats,

Here’s my SUPPORTING_VIEW which should be supplied with parameter p_star_date from the MAIN_VIEW.

define view SUPPORTING_VIEW
with parameters p_startCalculationDate: abap.dats
 as select from TABLE_FUNCTION( p_startCalculationDate: $parameters.p_startCalculationDate ) {
    
    
     fromDate, 
     toDate
     
}

The error occurs while I try to activate the MAIN_VIEW.

I tried to test this functionality a bit more in different scenarios to debug my problem and I noticed that e.g. it all works fine if I change the binding value to #CONSTANT and provide value manually:

@Consumption.derivation: {lookupEntity: 'SUPPORTING_VIEW', resultElement: 'fromDate', binding: [{targetParameter: 'p_startCalculationDate', type: #CONSTANT, value: '20190101' }]}
p_fromDate: abap.dats,

Have anyone encountered and solved the problem with this error?

BR,

Mateusz.

1 ACCEPTED SOLUTION

DoanManhQuynh
Active Contributor
1,091

i dont have 7.5 system to try, can you try @Consumption.hidden = false before p_startDate?

3 REPLIES 3

DoanManhQuynh
Active Contributor
1,092

i dont have 7.5 system to try, can you try @Consumption.hidden = false before p_startDate?

MateuszTrojanow
Explorer
0 Kudos
1,091

Hello Quynh Doan Manh,

The addition you had suggested in your answer, helped.

Do you know why it's necessary to hide the parameter? The documentation doesn't mention it.

(I would mark your asnwer as correct, but you submitted it as a comment).

0 Kudos
1,091

sorry I don't have answer for this question, it just a feeling that annotation @Consumption.hidden could be the trick. lets other expert look at this :).