SAP S/4HANA Cloud SDK: Version 1.9.3 is Available
The new version of the SAP S/4HANA Cloud SDK Java libraries is available since today. You can update your dependencies to version 1.9.3 and consume the new version from Maven Central. We have also released version v6 of our out-of-the-box continuous delivery offering consisting of a ready-made Jenkins server and a complete delivery pipeline.
In this blog post, we will walk you through the highlights of these releases. For a complete overview, visit our release notes for the Java libraries and for the continuous delivery pipeline. The release notes also include the change log of all our releases so far.
At the end of the article, you will find a set of instructions on how to update to the new versions.
Java Libraries: Release Highlights
Complex Filter Expressions
The new release expands the Java virtual data model (VDM) for OData services of SAP S/4HANA with support for complex filter expressions for OData queries. We added the logical operators for
not to the fluent API of the VDM. Together with the previously existing
and operator, this allows you to define advanced filter criteria when constructing a query to an OData service.
For example, to retrieve all business partners that are either male or have the first name Alice, you can write the following fluent and easy-to-understand code:
new DefaultBusinessPartnerService().getAllBusinessPartner() .filter(BusinessPartner.IS_MALE.eq(true) .or(BusinessPartner.FIRST_NAME.eq("Alice"))) //...
To negate the filter expression and search instead for business partners who are neither male nor named Alice, use the following code:
import static com.sap.cloud.sdk.s4hana.datamodel.odata.helper.ExpressionFluentHelper.not; // ... new DefaultBusinessPartnerService().getAllBusinessPartner() .filter(not( BusinessPartner.IS_MALE.eq(true) .or(BusinessPartner.FIRST_NAME.eq("Alice")) )) //...
The API for filter expressions is fluent and simple-to-use, while adhering to the Java syntax and semantics. You need to keep in mind that the chained method calls will be executed from left to right, so that there is no explicit precedence of operators. Please pay attention to the Javadoc of the operator methods (linked above).
We have published a new deep dive on the topic of tenant and user aware microservices communication via REST APIs. This communication between apps and services is an important building block for micro-service based distributed application and relies on the support for App-to-App SSO released with version 1.9.2 of the SAP S/4HANA Cloud SDK – based on the destination service (beta) on Cloud Foundry.
This new release of the SAP S/4HANA Cloud SDK updates the dependency to the SAP Cloud Platform SDK for service development to version 1.13.1. In the SAP S/4HANA Cloud SDK, this library is mostly used internally in the VDM for OData services. You may be using the library directly when manually constructing OData requests, for example, using the
ODataQueryBuilder. Please consult the release notes of the SAP Cloud Platform SDK for service development at help.sap.com for more information.
Version 1.9.3 improves the error messages that occur when destinations fail to be retrieved when using the destination service (beta) on SAP Cloud Platform Cloud Foundry, so that the root cause is easier to spot, for example, a missing service binding.
More improvements are listed in the full release notes.
Continuous Delivery Pipeline: Release Highlights
Backup and Restore of Jenkins
The continuous delivery offering includes a ready-made Jenkins server image. With release v6, you can create a backup of the Jenkins and restore it to a previously created backup. We highly recommend to take regular backups of the Jenkins volume using this mechanism.
As before, you can manage the Jenkins server using the
cx-server command line tool on any Linux machine. For backup and restore, use the two new options
restore on the command line as follows:
./cx-server backup # At a later point in time, if necessary ./cx-server restore /path/to/backup/jenkins_home_2018-03-15T0900UTC.tar.gz
This will create a backup of the
jenkins_home volume that contains the state of the Jenkins server such as settings, workspaces, and job details. For more details, please refer to the newly available operations guide for the continuous delivery server.
This release introduces a download cache for Maven and npm artifacts to improve performance when retrieving dependencies from external repositories such as Maven Central.
To mitigate the effect, we now offer a download cache that is enabled by default. A local Nexus Repository server acts as a transparent proxy for all Maven and npm dependencies. The cx-server script for managing the lifecycle of the continuous delivery server automatically starts the download cache. The continuous delivery pipeline transparently uses the download cache.
If you want to disable the download cache, for example, because you host your own Nexus server, disable it by putting
cache_enabled=false into the
server.cfg file for the cx-server script. You can also manually configure the repositories that the download cache will access (by default: Maven Central and npm registry). For more details, please refer to the operations guide for the continuous delivery server.
Automatic Versioning of Releases
Release v6 introduces automatic versioning of releases (and release candidates) to ensure auditability while keeping the effort for releasing minimal.
With continuous delivery in place, each commit on the productive branch is a new release, because it gets deployed to production automatically when using the pipeline. Additionally, our pipeline gives the option to automatically upload build artifacts to an artifact repository. This allows you to audit the exact artifact deployed to production at any time.
With the new automatic versioning, each commit on the productive branch (often:
master) gets assigned a version number that is derived from the timestamp and commit id of the commit. The pipeline will transparently set this version automatically for all Maven artifacts. It will neither create a commit with this version nor tag the commit in the repository. This document explains the concept behind automatic versioning in more detail.
To disable the automatic versioning, for example, for libraries with fixed versions, set the general configuration property
false as described in the configuration documentation.
We have released an operations guide for the continuous delivery server that explains the various options available for the cx-server script used for lifecycle management of the server.
You can find further fixes and improvements in the complete release notes.
How to Update
To update the version of the SAP S/4HANA Cloud SDK Java libraries used in an existing project, proceed as follows:
- Open the pom.xml file in the root folder of your project.
- Locate the dependency management section and therein the
- Update the version of that dependency to
With this, you are already done thanks to the “bill of material” (BOM) approach. Your dependency should look like this:
<dependencyManagement> <dependencies> <dependency> <groupId>com.sap.cloud.s4hana</groupId> <artifactId>sdk-bom</artifactId> <version>1.9.3</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> <!-- possibly further managed dependencies ... --> </dependencyManagement>
You can now recompile your project (be aware of the compatibility notes, though) and leverage the new features of the SAP S/4HANA Cloud SDK in version 1.9.3.
Continuous Delivery Pipeline
If you are using the pipeline as offered out-of-the-box and did not specify any specific version, you will automatically use the latest version and only need to update the Jenkins image as follows.
To update the Jenkins image as used by the cx-server script, run the following commands on the server hosting the cx-server:
./cx-server backup ./cx-server stop ./cx-server remove ./cx-server start