namespace my.bookshop;
entity Books {
key ID : Integer @title: 'ID';
title : String @title: 'Title';
category: String @title: 'Category';
stock : Integer @title: 'Stock';
}
entity BooksAggregate as projection on Books {
ID,
title,
category,
stock
}
using my.bookshop as my from '../db/data-model';
service CatalogService {
@readonly entity Books as projection on my.Books;
@readonly entity BooksAggregate as projection on my.BooksAggregate;
}
using CatalogService from './cat-service';
//aggregation annotations
// v4
annotate CatalogService.BooksAggregate with @(
Aggregation.ApplySupported: {
GroupableProperties: [
ID,
title,
category
]
},
Aggregation.CustomAggregate #stock: 'Edm.Int32'
){
stock @Analytics.Measure @Aggregation.default: #SUM
}
// v2
annotate CatalogService.BooksAggregate with @(
sap.semantics: 'aggregate'
){
ID @sap.aggregation.role: 'dimension';
category @sap.aggregation.role: 'dimension';
title @sap.aggregation.role: 'dimension';
stock @sap.aggregation.role: 'measure';
};
"targets": {
"BooksAggregateList": {
"type": "Component",
"id": "BooksAggregateList",
"name": "sap.fe.templates.ListReport",
"options": {
"settings": {
"entitySet": "BooksAggregate",
...
"controlConfiguration" : {
"@com.sap.vocabularies.UI.v1.LineItem" : {
"tableSettings": {
"type": "AnalyticalTable"
}
}
}
}
}
},
annotate CatalogService.BooksAggregate with@(
UI: {
PresentationVariant: {
Total: [
stock
],
Visualizations: [
'@UI.LineItem'
]
},
"pages": {
"ListReport|BooksAggregate": {
"entitySet": "BooksAggregate",
"component": {
"name": "sap.suite.ui.generic.template.ListReport",
"list": true,
"settings": {
...
"tableSettings": {
"type": "AnalyticalTable"
},
"dataLoadSettings": {
"loadDataOnAppLaunch": "always"
}
}
},
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
13 | |
11 | |
5 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |