on 04-27-2017 2:51 PM
Hi,
If I have a CDS view with parameters which publishes an association, can I use this association in other CDS view as a data source?
For example:
I create a CDS view 'zck_view_with_param' which publish association '_vbap'.
@AbapCatalog.sqlViewName: 'zck_vbakp_vw'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'CDS View with Parameters'
define view zck_view_with_param
with parameters i_vbeln : vbeln
as select from vbak
association [0..*] to vbap as _vbap on $projection.vbeln = _vbap.vbeln
{
vbeln,
_vbap
}where vbeln = :i_vbeln
Now I want to use '_vbap' association as data source in other view 'zck_pathexpr_datasource'.
@AbapCatalog.sqlViewName: 'zck_soitm_vw'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'CDS View Pathexp Data Source'
define view zck_pathexpr_datasource
with parameters i_sno : vbeln
as select from zck_view_with_param(i_vbeln : $parameters.i_sno)._vbap as _soitm
association [0..1] to mara as _mara on $projection.matnr = _mara.matnr
{
vbeln,
posnr,
_soitm.matnr,
_mara.matkl
}
But I get an error message "Entity zck_view_with_param' requires parameter i_vbeln".
Can you suggest how to pass parameters in this case?
I tried select from zck_view_with_param(i_vbeln : $parameters.i_sno)._vbap
and select from zck_view_with_param._vbap(i_vbeln : $parameters.i_sno).
Both are not working. Please help.
Thanks in advance.
User | Count |
---|---|
80 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.