2018 Nov 14 12:06 PM
Dear Community,
I am trying ( without success ) to push down a parameter inside an ABAP CDS view in order to minimize the usage of inside projections;
I took the table COSB as an example since we find 16 monthly key figures that we want to transpose.
Lint doesn't like the usage of the parameter in this manner, which I can understand but Is it doable ? Any suggestion is really welcome.
@AbapCatalog.sqlViewName: 'ZTESTUNION'
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Attempt to execute conditional Union with Params'
define view ZCDS_UNION_PARAM
with parameters p_period : CO_PERIO
as select from cosb as C {
c.mandt,
c.lednr,
c.objnr,
c.gjahr,
c.kstar,
c.twaer as WAERS,
@Semantics.amount.currencyCode:'WAERS'
c.wog001
}
where :p_period = '001'
union
select from cosb as C {
c.mandt,
c.lednr,
c.objnr,
c.gjahr,
c.kstar,
c.twaer as WAERS,
@Semantics.amount.currencyCode:'WAERS'
c.wog002
}
where :p_period = '002'