on 11-01-2016 8:04 PM
Hi,
@AbapCatalog.sqlViewName: 'ZAJ_ASSO'
@ClientDependent: true
@AbapCatalog.compiler.compareFilter: true
@EndUserText.label: 'AJ Test Association'
define view Ztest_Aj_Asso
with parameters
p_calday : sydatum
as select from vbak as vb inner join vbap as VP
on vb.vbeln = VP.vbeln
{ key vb.vbeln,
vb.kunnr,
vb.erdat,
left(vb.erdat,6) as calyearmonth,
sum(case when vb.erdat between concat( $projection.calyearmonth ,'01') and $parameters.p_calday then vb.netwr else 0 end) as MTD
} where vb.erdat = $parameters.p_calday
group by vb.vbeln,vb.kunnr,vb.erdat
I want to calculate MTD, on using calculated "calyearmonth" i m getting this error, Kindly help to resolve, also is there any other way to calculate MTD QTD YTD
Hi Abhinandan,
Please try the below code.
@AbapCatalog.sqlViewName: 'ZAJ_ASSO'
@ClientDependent: true
@AbapCatalog.compiler.compareFilter: true
@EndUserText.label: 'AJ Test Association'
define view Ztest_Aj_Asso
with parameters
p_calday : sydatum
as select from vbak as vb
association[1] to vbap as VP on $projection.vbeln = VP.vbeln
{ key vb.vbeln,
vb.kunnr,
vb.erdat,
left(vb.erdat,6) as calyearmonth,
sum(case when vb.erdat between concat( $projection.calyearmonth ,'01') and $parameters.p_calday then vb.netwr else 0 end) as MTD
} where vb.erdat = $parameters.p_calday
group by vb.vbeln,vb.kunnr,vb.erdat
Regards
Biswajit Nag
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.