Skip to Content
Technical Articles
Author's profile photo Martin Frick

Multitenant SaaS applications on SAP BTP using CAP? Tried-and-True!

Important Links

Overview / Basic Scope / Advanced Scope / Expert Scope

SAP-samples GitHub Repository

Sustainable SaaS (SusaaS) sample application

Inspired by a recent partner co-innovation project with The Boston Consulting Group (BCG), this is the first post of a series on building a multitenant Software as a Service (SaaS) application on SAP Business Technology Platform (BTP). The use of the Cloud Application Programming Model (CAP) in the Cloud Foundry environment is the scenario’s main focus. In addition to this introduction and overview blog, three more posts on dedicated technical scopes will shortly be released. Once these are ready, you can find them here.

We highly suggest checking out the GitHub repository supplied alongside this article. It includes detailed instructions for setting up the multitenant SaaS sample application described in this post in your personal SAP BTP environment. Please be aware that the Expert Scope is still WIP so the GitHub repository and relevant documentation parts will be further improved. Okay, let’s keep the introduction brief and start right away with some history!

A tiny history of Software as a Service

In the beginning, the SAP space was formless and empty, and darkness covered everything. So, on the third day SAP created the Business Technology Platform and a place for Cloud development was born.

As a result, developers in prehistoric tribes all over the world began to learn about SAP BTP and the benefits it provides to humanity. The first applications were created in Pangaea’s many regions, such as eu10 and ap20. As the new SAP world was discovered by more and more indigenous people, incredible developments like SAP HANA Cloud and SAP Integration Suite were made available.

As time went on, even the wisest and oldest chiefs embraced SAP BTP as an established “fireplace” to gather around and code the newest applications, but there was one question that kept coming up, more loudly each time.

If a clever team from one tribe creates a helpful new product on SAP BTP, why not make a mint selling it to others who are willing to pay a monthly price for the new technology but may lack the time or abilities to do things themselves?

At this point, the concept of “Cave solutions as a Service” emerged. Since its inception, this concept and SAP BTP have developed, and these kinds of solutions are now known as “Software as a Service.”

Software as a Service in an SAP BTP context

This historical context will help explain why today’s blog post on the enigmatic and mythical subject of creating multitenant “Software as a Service” (SaaS) applications on SAP BTP is so important for our customers and partners.

While many SAP customers are already using the SAP Business Technology Platform for developing SAP-related enterprise applications or extensions, most tribes continue to keep them hidden in their own technological caverns. As in the traditional On-Premise world, innovations and useful tools are developed by customers and partners and deployed to environments that only dedicated employees or teams are allowed to access. This makes some people happy, but we all know that happiness is the only thing on earth that grows when shared, thanks to Albert Schweitzer.

So why not let other teams and tribes around the globe make use of development efforts and fantastic new solutions – and of course (yes – nothing has changed since we sat around the fire) – charge them a fair price for the use? Particularly for developments that don’t disclose any proprietary tribe secrets or confidential cave systems but provide fair value to other hunters and gatherers.

Today, a subject that was not given much attention in the community during the early days of SAP BTP is receiving a lot more. Software as a Service (SaaS) apps are being published on the SAP Store by an increasing number of SAP partner and customer tribes. Specialized frameworks are built to enable partners in publishing and commercializing their own SAP BTP solutions, particularly with cross-tribe initiatives like SAP Industry Cloud.

It does not matter if you are a lone warrior or a member of an established tribe. Whether you already have an SAP BTP solution helpful for other businesses or are working on an innovative idea that might wind up in a SaaS product – this technical blog series and the included GitHub sample repository will give you a solid introduction to get started!

Multitenant SaaS applications on SAP BTP

Let us have a quick recap, to make sure everyone is on board! What is the general concept behind multitenant SaaS applications, and why is SAP BTP a great foundation for the creation of fresh innovations?

Most of us are familiar with Software as a Service from a B2C (Business to Cave) perspective, looking at consumer applications like Dropbox, Office365, or Adobe Cloud. A vendor creates, maintains, and sells subscriptions of a standardized, reusable piece of software to thousands of consumers.

F. Flintstone – “Thousands of consumers? – Reminds me of the big fire-sale after the brilliant invention of firestones in the early days ante firestone (A. F.)!”

A SaaS product that is well-designed and has low TCO benefits both parties. Particularly when technological resources like storage, compute units, and memory are shared among multiple customer tenants (multitenant). As a result, the marginal costs of integrating a new tribe are minimized because savvy tribes can sell the same good to an almost infinite number of nearby caves without making any changes. By doing this, customers can enjoy a price that is far lower than that of a standalone, self-hosted service.

Evolution of Software as a Service

Although the concept of “Software as a Service” is nothing new and has been around for a while, it was not always simple to create SaaS apps. Fortunately, things have improved since the days of murky, cryptic wall murals, which date back to when our ancestors taught their offspring how to create SaaS applications. Visit the Get the idea of a SaaS application documentation of the related GitHub repository to learn more about IaaS, PaaS, and SaaS. For now, let us assume you are familiar with the SaaS basics and have a look at the SAP BTP example.

Many SAP BTP clients utilize SaaS products from SAP such as SAP Integration Suite, SAP Analytics Cloud, SAP Data Warehouse Cloud, or SAP Event Mesh. Due to the increasing demand from partners and customers, SAP has improved its development tools for interested developers out there yearning for innovation, by offering services like SAP HANA Cloud or SAP Event Mesh for multitenant use, or by giving developers access to libraries and frameworks to create their own SaaS applications.

This blog post series (heavily influenced by ancient experts and contemporary witnesses) will focus on the Cloud Foundry environment and demonstrate how to create your own SaaS application by utilizing SAP BTP standard tools and libraries like:

  • The CAP framework, which provides SaaS-related libraries and functionality out-of-the-box
  • SAP HANA Cloud, a perfect database fit for a multitenant SaaS application
  • API features of SAP Integration Suite that allow you to manage and monitor your SaaS APIs
  • SAP Fiori Elements as a dynamic but standardized user interface technology
  • the user management features of SAP Identity Authentication Service
  • and a ton more!

In our example, we will demonstrate how simple it is to share powerful but pricy resources like an SAP HANA Cloud database among several tenants. With each new customer, this will lower the cost of services, simplify maintenance, and increase the profitability of your SaaS application.

Software as a Service advantages of SAP BTP

While there exists a plethora of platforms and environments that may be used to create new applications, SAP BTP is a wonderful option for creating SaaS solutions within the SAP ecosphere for several reasons. Before providing you with a brief summary of the SaaS solution built in this blog post series, let us at least discuss some major differentiators, even though wise men from the early days would not recommend anything else.

  • SAP SaaS offerings

SAP BTP provides a very simple onboarding process for non-SAP developers to SaaS development tools and concepts, as demonstrated by a recent partner collaboration with The Boston Consulting Group (details available soon). The first prototype of your application can be up and running in no time thanks to well-established frameworks like CAP and services like SAP HANA Cloud designed to streamline the procedures of developing SaaS apps.

  • SAP integration scenarios

SAP BTP is the recommended platform for building integration scenarios for SAP solutions. Whether you want to connect to cloud solutions like SAP SuccessFactors or need a link to an on-premise system like SAP S/4HANA, your integration will run safely and smoothly thanks to services like SAP Cloud Connector and SAP Private Link. All things considered, using SAP BTP to build and host your SaaS solution will give your users significant freedom when connecting their own SAP products to your SaaS application.

  • SAP BTP services

SAP Event Mesh and SAP Integration Suite are just two samples of SAP BTP services made to work with and complement other SAP products. There are numerous connectors and out-of-the-box content that will make your job as a developer easier if your SaaS offering is intended to work with other SAP solutions. Combining enterprise capabilities like Application Logging, Autoscaling, Alert Notifications, CI/CD, and Custom Domain service, flawlessly linked with development frameworks like CAP, you will be able to kick-start your project.

  • SAP-certified applications

As a partner, you can get your multitenant SaaS application certified by SAP and sell them in the SAP Store. As the one-stop shop for the latest SaaS solutions, your software will be featured here among other outstanding developments. An SAP-certified application will give your clients confidence in the reliability and features offered by your solution and let them know that it was developed using SAP best practices.

  • Hyperscaler agnostic

Your multitenant SaaS application can be deployed with a minimal additional effort to environments like Google Cloud Platform, AWS, and Microsoft Azure giving you the greatest flexibility to choose among various hyperscalers.

  • Multi-Region deployment

If required, your SaaS application can be set up in a variety of different geographical locations. This enables minimal local latency and adherence to local requirements or regulations your SaaS customers might have.

These are just a few of the benefits of creating SaaS solutions on SAP BTP. By deploying an example application to your own SAP BTP account using Free (Tier) services in just a few minutes, you will discover in future posts how simple it is to get started with your own SaaS solution. A SaaS application? – Using SAP BTP Free (Tier) services? – In a few minutes? – That seems impossible! We will demonstrate why it is not!

Software as a Service sample use-case

Before exploring some architecture details and the different application scopes, let’s have a brief look at what this simple SaaS product will look like once deployed to your own SAP BTP environment.

Based on the latest partnership news between SAP and BCG on the topic of sustainable enterprises (details available soon), the application developed in this series provides a sample SaaS sustainability solution. The idea is to give SaaS subscribers the ability to examine the sustainability facets of their products, such as circularity measurements, sales-related key figures, or recycling data related to raw materials.

The sample application allows subscribers to create Projects to which an Administrator can assign Members to. Members can then create Assessments related to certain products and review sustainability indicators like material, recyclability, and sales data.

Sample App – Main menu

Sample App – Sustainability Assessment

Even though the application doesn’t make any sustainability recommendations, it will still give you an idea of how simple it is to develop solutions and innovations for in-demand topics, especially if your app is built on common data available in well-adopted SAP solutions like SAP S/4HANA or SAP ECC.

Sample App – In-App User Management

Sample App – Project Member Management

The sample SaaS application is built in a way that handles user management and role assignment within the application itself, avoiding the need for access to the SAP BTP platform. Additionally, using the SaaS APIs, subscribers can push data from their own SAP systems like SAP S/4HANA. The required sample data is available in NetWeaver systems containing the so-called Enterprise Procurement Model (EPM). This allows you to import e.g., Sales and Product data in an automated fashion.

Sample App – Prefill with SAP S/4HANA data

Sample App – Prefilled assessment

As you can see in the screenshots, this data can then be loaded into the application to prefill the product-related assessments. The data can also be kept up to date within the SaaS application or uploaded using basic POST requests if you don’t have access to an SAP system.

With these solution screenshots in mind, let’s look under the hood of the sample project in the next chapter.

Software as a Service sample architecture

The application created for this series of blogs and made available in a GitHub repository includes many of the components and functionalities needed for an SAP BTP SaaS architecture. You will deploy the sample solution in accordance with SAP best practices to your personal SAP BTP global account and generate new subscriber tenants by creating subscriptions in additional subaccounts.

You can get a sense of what to anticipate while implementing the entire scenario from the solution diagram below. While the most important artifacts have been highlighted, we highly recommend getting detailed architecture insights and learning more about the various solution components by visiting the related documentation in our GitHub repository (click here).Sample%20SaaS%20Application%20Architecture

Sample SaaS Application Architecture

We are well aware that not all developers in the community have access to an SAP BTP Enterprise Agreement (CPEA), Free Tier, or Pay-As-You-Go (PAYG) account, but still want to test and evaluate our scenarios. As a result, this sample is divided into three scopes with different technical requirements.

A Basic Scope that contains the majority of features and lets you run an end-to-end SaaS application in your own SAP BTP environment (PAYG, CPEA or even Trial). An SAP HANA Cloud-based database layer, a Node.js service layer that is built as a CAP application, and a Fiori Elements user interface are included. In addition to the usage of numerous enterprise-ready services like Autoscaling, Logging, and Alert Notification, this Basic Scope also includes a multitenant SaaS API. It enables subscribers to upload data to their tenant database container instances. The Basic Scope is also important for those of you who are interested in automation. It provides intriguing puzzle pieces for tenant onboarding, including the creation of sample destinations, routes, and users as well as the registration, and deployment of API service broker instances.

The Advanced Scope can be developed using an SAP BTP Pay-as-you-Go (PAYG) or CPEA account and includes components like SAP Identity Authentication Service (SAP IAS) for sophisticated security and user management. The scope enables your subscribers to onboard users without SAP Cloud Identity (S/P-users) credentials. You will also learn how to monitor and limit API traffic from a provider perspective, as well as how SaaS subscribers can set up push scenarios in source systems like SAP S/4HANA utilizing the multitenant SaaS API.

The Expert Scope covers a wide range of topics, simplifying the development process for your SaaS application. This scope will enable you to take advantage of our most recent partner collaboration experiences, from the use of SAP Continuous Integration and Delivery and SAP Cloud Transport Management service for continuous deployment of your app to the management of your subscriber database containers. You will learn about multi-region deployments of your SaaS application and how to tackle topics like Custom Domain usage. The Expert Scope will summarize it all and serve as the location for any further information and updates to the sample application.

After visual and technical insights on the outcome of this series, let us finish today’s story with some key differentiators compared to existing SaaS examples in the SAP BTP ecosphere.

Sample solution key differentiators

Although this sample application is undoubtedly not the first publication about SaaS application multi-tenancy, the following features set it apart from other rock paintings, blogs, and samples on creating SaaS apps on SAP BTP:

– Partner-validated (details available soon) based on the SaaS sample code and supported features

– Usage of standard frameworks (e.g., CAP, Fiori Elements) and tools (e.g., SAP API Management)

– Advanced security and central user management using SAP Identity Authentication Service

– Integration pattern besides SAP Cloud Connector based on a multitenant SaaS API

– Inclusion of various enterprise readiness features for a reliable SaaS application

– Samples for the automation of the consumer tenant onboarding process

– Advanced scenarios like multi-region deployment and custom domain challenges

– Using the latest SAP multitenant libraries (mtxs) and providing a shared database container sample

Summary and conclusion

Regardless of your level of SAP BTP knowledge or your level of familiarity with Software as a Service, this use-case aims to meet all target audiences. Nevertheless, the more you already know about SAP BTP, the simpler it will be for you to comprehend what is going on behind the scenes.

Therefore, we suggest you deploy the Basic Scope to your environment and delve deeper into the advanced and Expert Scope once you are well-versed in how to use the Basic Scope services and are familiar with the SaaS-related CAP features. On the other hand, if you’re brand-new to SAP BTP, take your time and carefully review the Basic Scope that has been provided before looking at the advanced or Expert Scope!

Overall, we are confident that you won’t regret setting up the sample scenario yourself. Who knows? Maybe your own SaaS application will turn out to be the next big thing in the SAP Store!

To learn more about how SAP BTP is helping partners and businesses succeed, also check out the “Accelerating Innovation and Time to Market with SAP BTP” article, some recent partner success stories or, if you’re interested in SAP BTP software partnership opportunities with SAP, please visit SAP PartnerEdge, Build for more information.

Finally, at the end of this blog post, let me express a special thanks to all involved BCG colleagues and the whole SAP team with Alper Dedeoglu, Uwe Klasing, Ajit Kumar Panda, Anirban Majumdar and James Rapp for contributing to this blog post, doing the end-to-end validation and providing the related sample application in GitHub. 

Further information

The development of SaaS apps has gained a lot of attention in recent years, and as a result, there are several additional resources and blogs that are both highly informative and useful. Check out a few of them below to find out more!

Co-Innovation project with The Boston Consulting Group

Circelligence by BCG: Innovate in the circular economy on SAP BTP

SAP Help

Developing Multitenant Applications in the Cloud Foundry Environment

Multitenancy in the ABAP Environment

SAP Discovery Center

Develop a Multitenant Extension Application in SAP BTP, Kyma Runtime

Extend a Kyma Based Multitenant Application With Day 2 Operations

Enrich a Kyma Based Multitenant Application with Additional Identity Features

SAP HANA Academy

SAP Business Technology Platform – Multitenant Business Applications

GitHub Repositories

https://github.com/SAP-samples/btp-cf-multitenant-extension

https://github.com/SAP-samples/btp-kyma-multitenant-extension

https://github.com/SAP-samples/btp-kyma-day2-operations

Blogs

Fundamentals of Multitenancy in SAP BTP

Develop a Multitenant Extension Application in SAP BTP, Kyma Runtime

Develop and Register Multitenant Application to the SAP SaaS Provisioning Service on the SAP BTP

The hidden life of ServiceManager handled containers

Getting your head into Cloud Application Programming model multitenancy

Assigned Tags

      2 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Naga Prakash Timmaraju
      Naga Prakash Timmaraju

      Thanks for great blog, saving data on SAP HANA Cloud in Provider Subaccount. Do you think will be concerns from customer?

      Author's profile photo Martin Frick
      Martin Frick
      Blog Post Author

      Hi Naga Prakash Timmaraju,

      thanks for that interesting question! As always when giving data out of your own hand, there will be concerns by customers. This is something natural and it's up the SaaS provider to dispel these concerns. While the data itself is stored isolated from any other customer data using the powerful container concept, the SaaS vendor needs to ensure, that especially provider-based access to customer data is only granted to administrators/supporters under very exceptional circumstances. No developer should e.g., ever have access to a productive provider subaccount and any support/emergency access should be logged and limited to a certain timeframe.

      Overall, this whole question is about trust between the SaaS provider and the SaaS customer. The SaaS provider needs to provide clear and trusted data safeguarding and protection measures that allow especially customer data access only in very rare and well-documented situations. On the other hand, the subscribing customer needs to be provided with a certain understanding of how his data is protected and also needs to trust the SaaS vendor! If there is a general distrust between the provider and the customer, it might be a challenge to convince a customer even of the safest solution on the market when it comes to SaaS and storing data securely with the provider.

      Finally, if a customer is in favor of using e.g., his own SAP HANA Cloud instance (but - keep in mind also SAP acts as kind of provider here), depending on how the SaaS solution is designed, it might be an option to offer customers a non-SaaS version of the app. Still, this will take away all great  benefits like a low TCO or reduced maintenance efforts and cause much higher costs on the customer side.

      I hope this provides some guidance to your question.

      Martin