@EndUserText.label : 'A Document Item Table'
@AbapCatalog.enhancementCategory : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #LIMITED
define table zaba_adoc {
@EndUserText.label : 'Document Number'
key docnum : abap.char(10) not null;
@EndUserText.label : 'Item Number'
key docln : abap.numc(4) not null;
doc_date : budat;
@EndUserText.label : 'Company Id'
company : abap.char(10);
@EndUserText.label : 'Region'
region : abap.char(10);
@EndUserText.label : 'Store Id'
store : abap.char(10);
@EndUserText.label : 'Property Tax'
prop_tax : abap.dec(15,2);
@EndUserText.label : 'Adertising'
advertising : abap.dec(15,2);
@EndUserText.label : 'Administration'
admin : abap.dec(15,2);
@EndUserText.label : 'Payrol'
payrol : abap.dec(15,2);
@EndUserText.label : 'Utilities'
utilities : abap.dec(15,2);
@EndUserText.label : 'Insurance'
insurance : abap.dec(15,2);
@EndUserText.label : 'Sales'
sales : abap.dec(15,2);
@EndUserText.label : 'Rent'
rent : abap.dec(15,2);
@EndUserText.label : 'Royalties'
royalties : abap.dec(15,2);
@EndUserText.label : 'Frenchise'
frenchise : abap.dec(15,2);
}
@AbapCatalog.sqlViewName: 'ZAVA10AGRDBV'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Aggregate Measures First'
define view ZABA_AAVAA_10AGGREGATE_DDL
with parameters
p_dayfr : char8,
p_dayto : char8
as select from zaba_adoc as _adoc
{
key docln,
count(*) as nrecs,
sum(_adoc.prop_tax) as prop_tax,
sum(_adoc.advertising) as advertising,
sum(_adoc.admin) as admin,
sum(_adoc.payrol) as payrol,
sum(_adoc.utilities) as utilities,
sum(_adoc.insurance) as insurance,
sum(_adoc.sales) as sales,
sum(_adoc.rent) as rent,
sum(_adoc.royalties) as royalties,
sum(_adoc.frenchise) as frenchise
}
where _adoc.doc_date between :p_dayfr and :p_dayto
group by
docln
____________________________________________________________________________________________
@AbapCatalog.sqlViewName: 'ZAVA20ADDDBV'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Add Meassures after Aggregation'
define view ZABA_AAVAA_20ADD_DDL
with parameters
p_dayfr : char8,
p_dayto : char8
as select from ZABA_AAVAA_10AGGREGATE_DDL( p_dayfr:$parameters.p_dayfr,
p_dayto:$parameters.p_dayto )
{
docln,
:p_dayfr as day_from,
:p_dayto as day_to,
nrecs,
prop_tax + advertising + admin + payrol + utilities + insurance as expenses,
sales + rent + royalties + frenchise as revenue
}
@AbapCatalog.sqlViewName: 'ZAVA10ADDDBV'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Add Measures First'
define view ZABA_AAVAA_10ADD_DDL
with parameters
p_dayfr : char8,
p_dayto : char8
as select from zaba_adoc as _adoc
{
key docln,
prop_tax + advertising + admin + payrol + utilities + insurance as expenses,
sales + rent + royalties + frenchise as revenue
}
where _adoc.doc_date between :p_dayfr and :p_dayto
___________________________________________________________________________________________
@AbapCatalog.sqlViewName: 'ZAVA20AGRDBV'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Aggregate Measures after They were Added'
define view ZABA_AAVAA_20AGGREGATE_DDL
with parameters
p_dayfr : char8,
p_dayto : char8
as select from ZABA_AAVAA_10ADD_DDL( p_dayfr:$parameters.p_dayfr, p_dayto:$parameters.p_dayto )
{
key docln,
:p_dayfr as day_fr,
:p_dayto as day_to,
count(*) as nrecs,
sum(expenses) as expenses,
sum(revenue) as revenue
}
group by
docln
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
10 | |
7 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |