Stelacon - Brücke

SAP Consulting & Development, Competent and Flexible

Personal Report: Proof-of-concept for the processing of a purchase transaction between two SAP S/4 Hana companies using a Hyperledger Blockchain on the SAP Cloud Platform

From the title above you can already see from which direction the idea for this project came: Before I started at STELACON, I wrote my master thesis at the TU Munich about exactly this topic. At first you might think of a term that shaped my studies: Buzzword Bingo. But the words "Hyperledger", "Blockchain", "SAP S/4 HANA" and "SAP Cloud Platform" do not only help Google to find our article, but also stand for a future which (almost) every consultant sees coming, while still generating big question mark in their eyes. Since I was in a similar situation before the preparation of my master thesis, this article should help to hear the terms not only in theory, but to see them applied and in particular their interaction in action. Maybe one or two even find interest in implementing such a project in their own system.

What is Blockchain anyway?

But back to the beginning. After I had started my research with the premise to deal with a topic about Blockchain, one thing became clear to me quickly: the first question is not "How does Blockchain work?" but rather "What is Blockchain?

Blockchain is a term that is spreading more and more in the professional world and in the media, but rather few people can actually describe it. Blockchain" is usually equated with "Bitcoin". This thought is understandable, since Blockchain and Bitcoin simultaneously had their first public appearance in the much-quoted white paper by Satoshi Nakamoto in 2008 (LINK). In fact, blockchain is a novel technology, while Bitcoin is the first application based on this Blockchain technology.

According to Springer Gabler Verlag (LINK), the Blockchain is a decentralized, chronologically updated database with a network-based consensus mechanism for permanent digital securitization of property rights. The blockchain thus forms the basis for peer-to-peer transactions and commitments by logging a specified amount of transaction data in blocks. Since each participant of the network owns the complete blockchain, the blockchain is considered tamper-proof. Only by occupying a large part of the network subsequent changes would go unnoticed.

The history of Blockchain

But enough of the mere theory. Why is Blockchain now at least known to even the biggest tech novices? A look into the recent past will help.
The rise of the Blockchain in the last years is unmistakable. While in the beginning following the first publication mainly the experts dealt with the topic, at the latest from the beginning of 2017 the interest of the broad society in the topic Blockchain increased more and more.

This interest is mainly due to one cause: the crypto currencies, often abbreviated as  "cryptos". These are one of the simplest implementations of Blockchain technology and depict virtual currencies that enable transactions without the addition of a third (trusted) party. The first and so far most successful representative of cryptos is the currency Bitcoin. Due to various influences, such as the demand for anonymity on the Internet, the rejection of central trust institutions or even pure speculation, Bitcoin's trade volume and thus also its importance have increased considerably in recent years with the peak happening in December 2017. Several local and digital shops have also begun to accept Bitcoin or other cryptos as a means of payment.

But Blockchain is more than just a database or a pure application of crypto currencies. It offers solutions and potential interfaces to go beyond existing applications and offer comprehensive solutions. As it is in the nature of the free market, new crypto currencies and Blockchain solutions have formed. While Ethereum was able to gain the upper hand in the mainstream and has won countless developers over, in the business area the Hyperledger project of the Linux Foundation tries to establish itself and has already been able to win over numerous partners such as IBM, Deutsche Bank, Daimler and SAP.
Although new solutions are constantly being explored here, Blockchain technology is still in its infancy and therefore lacks one thing in particular: real application cases and implementations.
And while the many small projects - of often volunteering community members - open up new avenues and create attention for the technology, there is exactly one decisive factor for the implementation of a technology on the market: the development and adaptation by companies.

But what advantage does the Blockchain actually have for companies? This is the parting of the ways. While some see Blockchain as a mass phenomenon favored by speculation and a lack of investment alternatives, others see the Blockchain as the new cure-all for corporate processes: Expensive data centers and other service providers become obsolete due to the decentralization of data, analog detours become digital possibilities due to a multitude of APIs, and arbitration is a thing of the past thanks to the irrevocability of data. As it is usually the case, the truth and thus the actual benefit of the Blockchain will probably lie somewhere in the middle of these two extremes. Personally, I consider the approaches of the Blockchain technology to be trendsetting and am therefore convinced that the technology will prevail in many elementary areas. The sense and actual application of crypto currencies, however, still have to be explored. In order to see and understand the application of the Blockchain, only one thing helps: to develop your own projects.

Blockchain & SAP

Therefore, the aim of the work was to find and implement a general, but as real as possible application case. As an SAP consultant working as a student trainee, I was confronted daily with the processes of companies of various sizes. And although these processes differed greatly in some cases, most had one common denominator: offering and selling goods as well as services. So the parameters for the project were quickly found:  The purchase and sale of products between two SAP S/4 HANA systems using Blockchain technology. Since, as mentioned above, SAP acts as a partner of the Hyperledger project, the blockchain aspect could be implemented on the SAP Cloud Platform using Hyperledger. Both SAP systems used were on-premise systems in order to maintain practical relevance, especially in Germany.
After intensive research, a rather simple concept has emerged.
 


While the logging and technical processing of the use case in the Hyperledger are handled on the SAP Cloud Platform, both the user interaction and the documentation of the document flow take place on the SAP S/4HANA systems. This requires individual implementations both on the purchase system and on the sales system. Both systems must communicate with the Hyperledger, which is why the decision was made to create an encapsulated RESTful framework. To ensure compatibility, reduce maintenance and increase flexibility, both systems use the same code for this purpose. The structure of the diagram reveals one of the most important framework conditions of this solution: All parts are modularized and help to integrate alternative solutions at different points.

Process of the Transaction

After discussing the theory of Blockchain and an outline of the architecture, the key question of this report is: How does a trading transaction between the two systems via Blockchain actually work?
To this end, it must first be clarified what is actually being traded. A bicycle was chosen here to illustrate the process. This has the advantage of offering a pleasant degree of complexity and realism at the same time. SAP itself also often presents a company selling bicycles as an example in training documents, making it even easier to decide on a bicycle as a pilot product for this project.
 


Now to the procedure. On system #1 (called S/4 Purchase in the figure) all user interaction of this project takes place. The user starts a transaction which automatically displays the products offered on the blockchain.
 


The user can now start the sales process for these products at the push of a button. The corresponding code in the so-called Smart Contract is triggered in the Hyperledger, which in turn initiates the sales process on system #2 (S/4 Sales). The Hyperledger confirms the creation of the request by returning a time stamp and a transaction ID, both of which are immortalized in the blockchain. This data is then displayed to the user in the open transactions.

This is where the advantages of Blockchain technology come into their own. Transactions are documented permanently and can be viewed transparently. By adding an additional layer in the form of a crypto currency, the payment and the associated legally secure documentation of payment flows would also be possible. No further intermediary is required. All these steps can be fully automated thanks to Smart Contracts and thus lead to a significant reduction in transaction duration and costs.

But back to the use case: As soon as the system #2 has confirmed the sale, the Hyperledger changes the owner of the product on the blockchain and returns the new time stamp and ID of this transaction to the system #1. The user can then see this in the completed transactions. This interface was implemented with a Dynpro due to the project context. However, a UI5/FIORI application could be implemented here without any problems.
The processes on the Hyperledger and System #2 are fully automated:
On the Hyperledger a Smart Contract (also called Chaincode) was implemented, which offers a CRUD architecture for HTTP requests from outside. Changes to the ownership status are irrevocably documented in the integrated ledger - and thus on a blockchain. All communication is encrypted using the OAuth protocol.

In order to stay close to a real-world application, the sales process was carried out and documented as customary on system #2. A customer order is followed by a delivery and later by picking and goods issue. An invoice is created at the end of the transaction. Finally, the transfer of the product is documented in the Hyperledger. Thus, the owner of each product can be determined without any doubt.

Conclusion & Future

The product of this work can confidently be called a Proof-of-Concept, since a trading transaction between two SAP systems was successfully implemented using a Blockchain. This also proves that Blockchain can be used not only in the area of crypto currencies, but also in practical scenarios, such as a business process. This is especially important in times of daily new crypto currencies, which try to use the inexperience of users for fast profit. With the right tools and an individual implementation, such a business process can also be implemented with standard SAP on-premise systems, as the Proof-of-Concept has shown. This is the foundation stone for digital networking in the sense of industry 4.0.

Some readers are now probably thinking: "But what is the use of the Blockchain for me here at all?". Immediate advantages are the unambiguous documentation of possessions and the decentralized control of a connection between two systems, which can also be in two different companies. But the actual advantages lie in the generic structure of this implementation. Both the use case and the systems can be easily exchanged. It is also possible to add other use cases and systems.

Exactly for that reason we are now looking for pilot projects. If you are interested in carrying out such a pilot project or simply want to explore the potential of Blockchain in your company, please contact us. We will be happy to show you the possibilities in a non-binding discussion and determine whether and how Blockchain can be used meaningfully in your company.