We have released new versions of the
SAP Cloud SDK. In detail, the following components are now available in new versions:
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,
for the JavaScript libraries, and
for the continuous delivery toolkit. 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 3.19.1
You can update your dependencies of the SAP Cloud SDK for Java to version 3.19.1 and consume the new version from
Maven Central.
Updated Data Model for SAP S/4 HANA Cloud
This release comes with an update of the OData virtual data model (VDM) to the
newest release 2005 of SAP S/4HANA Cloud. SAP Cloud SDK supports all OData services listed in the
SAP API Business Hub for SAP S/4HANA Cloud.
New Client Library for Workflow Service
SAP Cloud SDK now includes the client library for the
Workflow Service API on SAP Cloud Platform, Cloud Foundry.
Here is an example on how to use the new client.
final HttpDestination httpDestination = DestinationAccessor.getDestination(destinationName).asHttp();
final List<WorkflowDefinition> workflowDefinitions =
new WorkflowDefinitionsApi(httpDestination).getWorkflowDefinitions();
The following Maven module is available for including into your project.
<dependency>
<groupId>com.sap.cloud.sdk.services</groupId>
<artifactId>scp-workflow-cf</artifactId>
</dependency>
Read more about using the Workflow Service in
this blog post.
OData v4 Capabilities
The VDM request builder now supports fetching the count of entries from an entity collection endpoint. The result is a non-null
Long
, which is the number of matching entries according to optional filter and search expressions.
Example for the VDM usage:
long numEntries = new DefaultEntityService()
.countEntities()
.filter(SomeEntity.FIELDNAME.contains("foo"))
.search("bar")
.execute(someDestination);
Example for the generic usage:
long numEntries = new CountRequestBuilder<>("/odata/service/path/", SomeEntity.class)
.filter(SomeEntity.FIELDNAME.contains("foo"))
.search("bar")
.execute(someDestination);
The new SAP Cloud SDK version adds support for unbound actions in OData v4. The OData v4 generator generates unbound actions at the service level. Etag handling in actions is not supported at this time. Note: To enable this feature, regeneration of the VDM classes is required.
We introduced support for controlling the version identifier (ETag) submission when using the VDM request builders for OData v4 for deleting and updating entities
DeleteRequestBuilder
and
UpdateRequestBuilder
. The method
disableVersionIdentifier()
allows to avoid that the request header
If-Match
is sent at all. The method
matchAnyVersionIdentifier()
allows to control that the request header
If-Match
is sent with the value
*
. Note: If both methods are invoked on the same request builder, the latest invocation takes precedence.
Example for the VDM usage to delete an entity without sending a version identifier:
new DefaultEntityService()
.deleteEntity(entity)
.disableVersionIdentifier()
.execute(destination);
Example for the VDM usage to update an entity while sending the
*
value in the request header:
new DefaultEntityService()
.updateEntity(entity)
.matchAnyVersionIdentifier()
.execute(destination);
Further improvements
Several further improvements are listed in the
full release notes.
JavaScript Libraries: Release Highlights 1.20.0
The
JavaScript libraries of the SAP Cloud SDK are now available in version 1.20.0.
When executing and building requests with the generic
http-client
custom request configurations now take precedence over configurations resulting from the given destination. This applies to all
http-client
related functions:
buildHttpRequest
,
addDestinationToRequestConfig
,
execute
and
executeHttpRequest
.
The new version supports setting log levels for all loggers globally. Use
setGlobalLogLevel('debug')
for this. Log levels set individually still take precedence.
Further improvements
As usual, the
full release notes contain a list of all improvements in this release. For additional details, see
release notes for older versions.
How to Update
Java libraries
To update the version of the SAP 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
sdk-bom
dependency.
- Update the version of that dependency to
3.19.1
.
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.sdk</groupId>
<artifactId>sdk-bom</artifactId>
<version>3.19.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
<!-- possibly further managed dependencies ... -->
</dependencyManagement>
If you update from a version prior to 3.0.0, have a look at
our migration guide.
If you are using the SAP Cloud SDK in a project of the
SAP Cloud Application Programming Model, replace
sdk-bom
with
sdk-modules-bom
to only update the version of SDK modules, not further dependencies.
You can now recompile your project (be aware of the
compatibility notes, though) and leverage the new features of the SAP Cloud SDK in version 3.19.1.
Of course, you can also generate a new project that uses version 3.19.1 from the start by running the Maven archetypes for
Neo or
Cloud Foundry with
-DarchetypeVersion=3.19.1
(or
RELEASE
).
JavaScript libraries
To update the version of the SAP Cloud SDK JavaScript libraries used in an existing project, use the command
npm update
in the root folder of your module. Note that this will also update other modules, unless you explicitly specify which packages to update. If you want to check beforehand what will change, use
npm outdated
.
Continuous Delivery Toolkit
If you are using the pipeline with a fixed version (as recommended since v7), update the continuous delivery toolkit with the following command, that you run on the server hosting the cx-server:
./cx-server update image
Learn more about SAP Cloud SDK
To learn how others in the community use SAP Cloud SDK you can check out
more related blog posts.
Are you interested in a particular topic? It might be helpful to search the
Q&A place? Feel free to ask your question there and do not forget to select the tag
SAP Cloud SDK
.
If you are new to SAP Cloud SDK, get started and gain first hand-on exercise by following our
tutorials.