From ffe8ee055a05e904682599c921593a078cf63f19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20G=C3=B6rler?= Date: Tue, 29 Jul 2025 17:49:15 +0200 Subject: [PATCH 1/4] OData feature matrix --- advanced/odata.md | 48 ++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/advanced/odata.md b/advanced/odata.md index 34a671e416..1b1c57d6fa 100644 --- a/advanced/odata.md +++ b/advanced/odata.md @@ -1052,21 +1052,22 @@ If the `groupby` transformation only includes a subset of the entity keys, the r ### Transformations -| Transformation | Description | Node.js | Java | -|------------------------------|---------------------------------------------|:------------------:|:-----:| -| `filter` | filter by filter expression | | | -| `search` | filter by search term or expression | | | -| `groupby` | group by dimensions and aggregates values | | | -| `aggregate` | aggregate values | | | -| `compute` | add computed properties to the result set | | | -| `expand` | expand navigation properties | | | -| `concat` | append additional aggregation to the result | | | -| `skip` / `top` | paginate | | | -| `orderby` | sort the input set | | | -| `topcount`/`bottomcount` | retain highest/lowest _n_ values | | | -| `toppercent`/`bottompercent` | retain highest/lowest _p_% values | | | -| `topsum`/`bottomsum` | retain _n_ values limited by sum | | | - +| Transformation | Description | Node.js | Java | +|------------------------------|----------------------------------------------|:------------------:|:-----:| +| `filter` | filter by filter expression | | | +| `search` | filter by search term or expression | | | +| `groupby` | group by dimensions and aggregates values | | | +| `aggregate` | aggregate values | | | +| `compute` | add computed properties to the result set | | | +| `expand` | expand navigation properties | | | +| `concat` | append additional aggregation to the result | | | +| `skip` / `top` | paginate | | | +| `orderby` | sort the input set | | | +| `topcount`/`bottomcount` | retain highest/lowest _n_ values | | | +| `toppercent`/`bottompercent` | retain highest/lowest _p_% values | | | +| `topsum`/`bottomsum` | retain _n_ values limited by sum | | | +| `TopLevels` | retain only _n_ levels of a hierarchy | | | +| `ancestors/descendants` | retain ancestors/descendants of specific nodes | | | #### `concat` @@ -1105,17 +1106,15 @@ Provide support for hierarchy attribute calculation and navigation, and allow th | Transformation | Description | Node.js | Java | |-----------------------------------------------|------------------------------------------------------------------|:-------:|:------------------:| -| `com.sap.vocabularies.Hierarchy.v1.TopLevels` | generate a hierarchy based on recursive parent-child source data | (1) | (1) | -| `ancestors` | return all ancestors of a set of start nodes in a hierarchy | (1) | (1) | -| `descendants` | return all descendants of a set of start nodes in a hierarchy | (1) | (1) | - -- (1) Beta feature, API may change +| `com.sap.vocabularies.Hierarchy.v1.TopLevels` | generate a hierarchy based on recursive parent-child source data | (1) | | +| `ancestors` | return all ancestors of a set of start nodes in a hierarchy | (1) | | +| `descendants` | return all descendants of a set of start nodes in a hierarchy | (1) | | Generic implementation is supported on the following databases: | | SAP HANA | H2 | PostgreSQL | SQLite | |---|---|---|---|---| -| CAP Java | ✓ | ✓ | | | +| CAP Java | ✓ | ✓ | ✓ | | | CAP Node.js | ✓ | |✓ |✓ | :::info @@ -1152,8 +1151,11 @@ GET SalesOrganizations?$apply= | `average` | average of values | | | | `countdistinct` | count of distinct values | | | | custom method | custom aggregation method | | | +| custom aggregate | predefined custom aggregate1 | | | | `$count` | number of instances in input set | | | +1 CAP Node.js does not support custom aggregates for currencies or units of measure. + ### Custom Aggregates Instead of explicitly using an expression with an aggregation method in the `aggregate` transformation, the client can use a _custom aggregate_. A custom aggregate can be considered as a virtual property that aggregates the input set. It's calculated on the server side. The client doesn't know _How_ the custom aggregate is calculated. @@ -1188,7 +1190,7 @@ which is equivalent to: GET /Books?$apply=aggregate(stock with sum as stock) HTTP/1.1 ``` -#### Currencies and Units of Measure +#### Currencies and Units of Measure {.java} If a property represents a monetary amount, it may have a related property that indicates the amount's *currency code*. Analogously, a property representing a measured quantity can be related to a *unit of measure*. To indicate that a property is a currency code or a unit of measure it can be annotated with the [Semantics Annotations](https://help.sap.com/docs/SAP_NETWEAVER_750/cc0c305d2fab47bd808adcad3ca7ee9d/fbcd3a59a94148f6adad80b9c97304ff.html) `@Semantics.currencyCode` or `@Semantics.unitOfMeasure`. The aggregation method (typically, sum) is specified with the `@Aggregation.default` annotation. @@ -1222,7 +1224,7 @@ A custom aggregate for a currency code or unit of measure should also be exposed | chain transformations | | | | chain transformations within group by | | | | `groupby` with `rollup`/`$all` | | | -| `$expand` result set of `$apply` | | | +| `$expand` result set of `$apply` | | | | `$filter`/`$search` result set | | | | sort result set with `$orderby` | | | | paginate result set with `$top`/`$skip` | | | From 02b36cc78dc66823ed5ec73dadbef1035bd7f62b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20G=C3=B6rler?= Date: Mon, 13 Oct 2025 11:28:42 +0200 Subject: [PATCH 2/4] Update advanced/odata.md --- advanced/odata.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/advanced/odata.md b/advanced/odata.md index 4c4d23a9ac..924ca00890 100644 --- a/advanced/odata.md +++ b/advanced/odata.md @@ -1105,10 +1105,11 @@ If the `groupby` transformation only includes a subset of the entity keys, the r | `topcount`/`bottomcount` | retain highest/lowest _n_ values | | | | `toppercent`/`bottompercent` | retain highest/lowest _p_% values | | | | `topsum`/`bottomsum` | retain _n_ values limited by sum | | | -| `TopLevels` | retain only _n_ levels of a hierarchy | | 1 | -| `ancestors/descendants` | retain ancestors/descendants of specific nodes | | 1 | +| `TopLevels` | retain only _n_ levels of a hierarchy | 2 | 1,2 | +| `ancestors/descendants` | retain ancestors/descendants of specific nodes | 2 | 1,2 | 1 - supported on SAP HANA, H2 ad PostgreSQL only +2 - only to support requests from the UI5 Tree Table #### `concat` From e348287f76e3f999a21c960de2d016e85b46c80c Mon Sep 17 00:00:00 2001 From: Robin Date: Mon, 13 Oct 2025 11:40:55 +0200 Subject: [PATCH 3/4] Update advanced/odata.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: René Jeglinsky --- advanced/odata.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/odata.md b/advanced/odata.md index 924ca00890..2e2bdb1937 100644 --- a/advanced/odata.md +++ b/advanced/odata.md @@ -1190,7 +1190,7 @@ which is equivalent to: GET /Books?$apply=aggregate(stock with sum as stock) HTTP/1.1 ``` -#### Currencies and Units of Measure {.java} +#### Currencies and Units of Measure If a property represents a monetary amount, it may have a related property that indicates the amount's *currency code*. Analogously, a property representing a measured quantity can be related to a *unit of measure*. To indicate that a property is a currency code or a unit of measure, it can be annotated with the [Semantics Annotations](https://help.sap.com/docs/SAP_NETWEAVER_750/cc0c305d2fab47bd808adcad3ca7ee9d/fbcd3a59a94148f6adad80b9c97304ff.html) `@Semantics.currencyCode` or `@Semantics.unitOfMeasure`. The aggregation method (typically, sum) is specified with the `@Aggregation.default` annotation. From 2e917d5b864daccbede378f16179edc259b4ddd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20G=C3=B6rler?= Date: Tue, 28 Oct 2025 09:56:57 +0100 Subject: [PATCH 4/4] Update advanced/odata.md Co-authored-by: Johannes Vogel <31311694+johannes-vogel@users.noreply.github.com> --- advanced/odata.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/advanced/odata.md b/advanced/odata.md index 2e2bdb1937..2e5e50f7bf 100644 --- a/advanced/odata.md +++ b/advanced/odata.md @@ -1151,10 +1151,9 @@ This query groups the 500 most expensive books by author name and determines the | `average` | average of values | | | | `countdistinct` | count of distinct values | | | | custom method | custom aggregation method | | | -| custom aggregate | predefined custom aggregate1 | | | +| custom aggregate | predefined custom aggregate | | | | `$count` | number of instances in input set | | | -1 CAP Node.js does not support custom aggregates for currencies or units of measure. ### Custom Aggregates