There are some interesting new features available in SAP Business One Service Layer version for SAP HANA 9.2 PL03 version that I will like to shortly highlight in this blog.
- Service Layer supports grouping on oData query
B1 Service Layer: Grouping
Note: 2312981 – Service Layer supports grouping on OData query (S-user required)
Grouping behavior is triggered using the query option apply and the groupby keyword. This keyword specifies the grouping properties, a comma-separated list of one or more single-valued property paths that is enclosed in parentheses.
For example, to group the orders by CardCode, DocEntry, send a request like:
GET /b1s/v1/Orders?$apply=groupby((CardCode, DocEntry))
GET /b1s/v1/Orders?$apply=groupby((Orders/CardCode, Orders/DocEntry))
- Service Layer supports simple aggregation on oData query
B1 Service Layer: Aggregation
Note: 2312964 – Service Layer supports simple aggregation on OData query (S-user required)
Aggregation behavior is triggered using the query option $apply. Any aggregate expression that specifies an aggregation method MUST define an alias for the resulting aggregated value. Aggregate expressions define the alias using the as keyword, followed by a SimpleIdentifier. The alias will introduce a dynamic property in the aggregated result set. The introduced dynamic property is added to the type containing the original expression.
Currently, the supported aggregation methods include sum, avg, min, max, count and distinctcount.
For example, to sum the DocRate of the Orders, send a request like:
GET /b1s/v1/Orders?$apply=aggregate(DocRate with sum as TotalDocRate)
Of course many other query options are available already in Service Layer ($filter, $select, $orderby, $top, $skip,…). Please check Service Layer documentation for more details.
- Attachment manipulation
B1 Service Layer: Attachment manipulation
Note: 2312947 – Service Layer supports attachment manipulation (S-user required)
You can create attachments via Service Layer, source can be Linux or Windows machine. You can also update and download attachments via Service Layer.
For more details on these new features please have a look to the User Manual document always available in your SAP Business One Service Layer installation:
SAP Business One Service Layer version for SAP HANA 9.2 PL03 is already available for download, don’t wait for testing all these new features!