2019 Jul 04 2:33 PM
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.
2019 Jul 08 6:19 AM
i dont have 7.5 system to try, can you try @Consumption.hidden = false before p_startDate?
2019 Jul 08 6:19 AM
i dont have 7.5 system to try, can you try @Consumption.hidden = false before p_startDate?
2019 Jul 08 2:41 PM
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).
2019 Jul 09 1:19 AM
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 :).