Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
HenningH
Product and Topic Expert
Product and Topic Expert
608
The new version of the SAP S/4HANA Cloud SDK Java libraries is available since today. You can update your dependencies to version 2.12.0 and consume the new version from Maven Central.
In this blog post, we will walk you through the highlights of this release. For a complete overview, visit our release notes for the Java libraries. 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 version.


Java Libraries: Release Highlights


Additional capabilities for executing remote BAPIs


In addition to offering premium support for HTTP-based access to SAP S/4HANA Cloud systems like OData or SOAP APIs, the SDK also includes components that make it easy to communicate via RFC with BAPIs and remote function modules (RFMs) in on-premise ERP systems. The two main classes to use these features are the BapiQuery and RfcQuery classes. This release includes several improvements for this capability.

Both classes now allow callers to decide how to deal with errors during remote execution of BAPI or RFM by specifying an own error handler. The error handler can decide based on the passed BapiQueryResult or RfcQueryResult if a RemoteFunctionException shall be thrown. In addition, both BapiQuery and RfcQuery offer convenience methods as part of their fluent API to always ignore errors or to always propagate them as exceptions. The default, as before, is always propagating errors as exceptions.

Version 2.12.0 also fixes an issue where BapiQuery and RfcQuery had been committed asynchronously despite the API promising a synchronous commit. The implicit transaction commit is now done synchronously by default. This fix assures that changes have propagated completely to the ERP system before the execution of your application continues. If your code relies on an asynchronous commit or does not need the added safety of waiting for the commit to succeed, you can toggle the previous behavior by using the newly introduced optional parameter on the query constructor that expects a CommitStrategy. The CommitStrategy offers a third option in addition to synchronous and asynchronous commit that allows not committing the call.

Further improvements


The OData virtual data model (VDM) now allows passing a FilterExpression from the SAP Cloud Application Programming Model as an UncheckedFilterExpression. Please note that this approach discards type-safety and should only be used when it is desired to pass a filter query option directly, for example, when you are implementing a custom handler as part of the OData provisioning capabilitiy of the programming model. In that case, use the FilterExpressionConverter provided by the Cloud Application Programming Model to convert an expression retrieved via getQueryExpression from a query request to a FilterExpression:
myService.getAllSomething()
.filter(new UncheckedFilterExpression<>(
FilterExpressionConverter.convertTo(
queryRequest.getQueryExpression())))
.execute();

Do you want to move your application from SAP Cloud Platform Neo to Cloud Foundry? Here is a new blog post that step-by-step explains how to move an application with the SAP S/4HANA Cloud SDK to Cloud Foundry.

Several further improvements are listed in the full release notes.

How to Update: Java libraries


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 sdk-bom dependency.

  • Update the version of that dependency to 2.12.0.


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>2.12.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
<!-- possibly further managed dependencies ... -->
</dependencyManagement>

If you are using the SAP S/4HANA 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 S/4HANA Cloud SDK in version 2.12.0.

Of course, you can also generate a new project that uses version 2.12.0 from the start by running the Maven archetypes for Neo or Cloud Foundry with -DarchetypeVersion=2.12.0 (or RELEASE).
2 Comments