Showing results for 
Search instead for 
Did you mean: 

Passing values to input parameters using associations in CDS Views

Former Member
0 Kudos

Hi All,

Im trying to pass values to input parameters while doing an association between two CDS views. My scenario is as follows:

I have time-dependent HANA view H1 that has keyDate as input parameter. Created a CDS table function CDS1 on H1 and was able to pass inputs to the keyDate. While Im doing an association with another CDS view CDS2, I would want to pass a date from CDS2 to keyDate. I was able to pass current date using the following syntax,

associationDetails(keyDate : $session.system_date).column1, but getting an error while trying to pass a value from CDS2.

Is this scenario possible?

Accepted Solutions (1)

Accepted Solutions (1)

Product and Topic Expert
Product and Topic Expert

Answers (1)

Answers (1)

Active Participant
0 Kudos

There is way to do so below is example :

Parameters can’t be directly used within the definition on Associated targets. But you can expose fields in the associated target CDS view as shown in below example.

CDS with Parameter (to be used as association target)





@EndUserText.label:'Sales Order Item with Parameters'

defineview ZC_ZYX

withparameters p_matkl : matkl


selectfrom vbap {

key vbeln,

key posnr,






where matkl =:p_matkl

Then Final CDS view where we want to use association --






@EndUserText.label:'Sales Order Header with Associations & Parameters'

defineview ZC_ZZYX


p_matkl1 : matkl,

p_vbeln1 : vbeln


selectfrom vbak

association[0..*]to ZC_ZYXas _item

on$projection.vbeln = _item.vbeln


key vbeln,

key _item(p_matkl::p_matkl1).posnr,






where vbeln =:p_vbeln1

This will work similar to Right outer join. Alternatively, You can use CDS “ZC_ZYX” view as primary data source in Final CDS.


Abhijeet Kankani