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: 
LudoNoens
Product and Topic Expert
Product and Topic Expert

This blog post is the fourth in a series of posts that cover the connectivity options available for SAP Build Apps to interface with SAP systems. The series will cover connecting SAP Build Apps with the following:

  1. CAP-based services
  2. S/4HANA systems
  3. ABAP systems

The format of this post is similar to a tutorial. However, I'll provide more comprehensive details, tips and the opportunity for you to provide feedback. Based on the feedback we will be able to adjust and enhance this post and future parts of the series, and might even be able to improve the products involved as well. 

Introduction 

Before we get into the details of setting up connections between SAP Build Apps and SAP Systems, I intend to introduce a couple of SAP technology components in each post that are relevant for the use cases covered in the series. 

SAP Build Work Zone

SAP Build Work Zone is a digital workplace experience that enables users to build and customise business sites that provide centralised access to business application information from any device.

Key capabilities are:

  • Quickly create corporate websites providing secure and central access for apps, tasks, notifications, information and communication.
  • Easily connect with SAP and third-party enterprise applications.
  • Provide a personalised and role-based user experience.
  • Provide an extensible framework for development, customisation and branding.

The service is currently available in 2 editions:

  1. Standard edition - this is basically the same as what we previously called the SAP Launchpad service. This is the edition we will use in this blog post. It has a strong focus on integration of business applications.
  2. Advanced edition - this is what we previously referred to as the SAP Work Zone service. It includes additional capabilities on top of what is available in the standard edition. The information in this blog post can be applied in this edition as well. You typically subscribe to only one edition. The advanced edition adds capabilities around workspaces, knowledge management and user engagement.

LudoNoens_2-1714381872196.png

MTAR

A multitarget application (MTA) is comprised of multiple parts (also referred to as "modules"), created with different technologies and deployed to different targets, but with a single, common lifecycle.

A multitarget application archive (MTAR) is an archive that contains a deployment descriptor, configuration files, and module and resource binaries. The archive follows the JAR file specification. A JAR file is essentially a zip file that contains an optional META-INF directory.

LudoNoens_0-1714474595732.png

An example relevant for the use cases in this blog series is an MTAR created in SAP Build Code that contains the Destination, a node.js based CAP service, and a HANA database deployment application for setting up the persistency layer. All are deployed during a single deployment action, for a specific version of the archive.

 

Use case D : Consume the CAP service with a web app provided in SAP Build Work Zone

For this use case, we will make use of the previously created basic CAP service in SAP Build Code. In the previous blog post, we have created dedicated mobile apps for the iOS and Android platforms to consume this service with SAP Build Apps. We will now use the exact same UI application to build and deploy a web application to SAP Business Technology Platform. After that, we will configure SAP Build Work Zone to provide access to the application.

Solution diagram

Like in the previous blog post, we will start with a quick look into what needs to change in our solution overview to accommodate for web apps. Building upon the solution diagram created earlier, we now add SAP Build Work Zone, standard edition. The design time environment of SAP Build Apps will deploy the web application to the HTML5 Application Repository service. The application is made available to end users through SAP Build Work Zone, which is configured separately. End users can access the web app from any device. The web app authenticates with the Identity Authentication service (IAS) and accesses data via a Destination. Only users who have the correct Roles assigned will be able to access the data provided in the CAP-based data service.

LudoNoens_1-1714476179455.png

Building the web app in SAP Build Apps

As the application we have developed so far is actually a cross-platform app, we don't need to change anything in the app itself. We simply need to build it for a different runtime. And for this, we will again make use of the cloud build service we have utilised in the previous blog post.

Starting in SAP Build Apps, navigate to the Launch tab and select Open build service.

Pasted Graphic.png

Next, select CONFIGURE for the Web App.

Web App.png

For the Bundle Settings, select MTAR and click NEXT.

Pasted Graphic 3.png

In the Image Assets tab, upload a 32 x 32 pixel icon image (PNG file) for the Favicon and click NEXT.

Pasted Graphic 4.png

On the Plugins tab, you can add React Native plugins for your app. For our app you can see a few plugins have been selected by default, based on the functionality we have already added in the app. We can use the default selection in this case and click NEXT.

Pasted Graphic 5.png

Now that we have completed configuring the web app build settings, select BUILD.

 BUILD.png

Select MTAR and the Client runtime version. Provide a version number for your application. Select BUILD.

Once the build is done, you will be able to download the MTAR file, or simply deploy the MTAR.

Web App.png

Select DEPLOY MTA.

Pasted Graphic 1.png

Select the Cloud Foundry API endpoint of your target subaccount. In our case, we will use the same subaccount as the one we have set up in the first blog post of this series. 

Log in to Cloud Foundry and to get authorization to perform deployment to SAP Business Technology Platform.

Pasted Graphic 2.png

Once you've selected your target Cloud Foundry organisation and space, select DEPLOY MTA TO <your space name> 

LudoNoens_0-1714460808947.png

The deployment process will start and your web application will be deployed to the HTML5 Application Repository Service. You can track the progress in the logs.

LudoNoens_1-1714461015698.png

Once the deployment finishes, the URL to your application will be shown.

LudoNoens_2-1714461129985.png

When you try to open the URL, you are quite likely greeted with the message "Internal Server Error". Looking into details in your browser's developer tools, you can find a response code 500. This indicates something has not been set up correctly (yet). Not to worry ... we'll fix this in the following steps.

If your subaccount was correctly configured, then you should actually see the web app.

 

Provide access to the web app in SAP Build Work Zone

We are now going configure SAP Build Work Zone. There are multiple ways to access this. In the context of SAP Build, we can start from the SAP Build landing page. On the landing page, select the Create button.

What would you like to do ? Well, we'd like to Build a Business Site !

LudoNoens_3-1714461673821.png

Select Configure Site in Admin Console.

Note that in the screenshot below the tile "Manage Workspages and Workspaces" is marked as 'Not Subscribed'. This is because I am using the standard edition of SAP Build Work Zone, which was subscribed through the "Get started with SAP Build Apps" booster. If you have a subscription to the Advanced Edition, then this tile can be selected as well.

Which site would you like to configure.png

Alternatively, if you are not using SAP Build, you can configure SAP Build Work Zone by opening the link in your subaccount's cockpit.

As prerequisite, please check whether your user has the Role Launchpad_Admin assigned.

Description.png

Once configured (and you might need to log out & log in to activate that Role), navigate to the subscriptions and open the link to SAP Build Work Zone, standard edition.

Subscriptions (7).png

SAP Build Work Zone configuration

Now, let's set up a business site that includes our app. Select Create Site.

Pasted Graphic 10.png

Provide a name for the Site and click Create.

Create Site.png

Navigate to the Content Manager tab and select the Content Explorer button.

Pasted Graphic 12.png

The Content Explorer will open.

Pasted Graphic 13.png

Click on HTML5 Apps to see which apps have been deployed to the HTML5 Application Repository. You will see the app we've created in SAP Builds Apps. Besides that, you will also notice the Launchpad for the products service we've deployed from SAP Build Code. Select the app created and deployed with SAP Build Apps and click the Add button.

Pasted Graphic 15.png

Going back to the Content Manager, select the Create button and create a new group. Give the group a name and assign the previously added app to the group.

Pasted Graphic 16.png

Go back to the Content Manager and select the Everyone Role. Enable the previously selected app to be accessible for everyone. Note that this will give users access to the web app itself. Access to the data service is still limited to those having the Role we have configured in the second blog post of this series.

Pasted Graphic 17.png

 

Resolving the "Internal Server Error"

And now for the previously mentioned 500 response code, resulting in "Internal Server Error". This happens when the authentication mechanism for SAP Build Work Zone and SAP Cloud Portal service uses XSUAA, while your subaccount is actually configured to use a custom IdP (IAS). To switch to Identity Authentication, navigate to the Settings, select the Identity Authentication tab and click Enable (please read the notes before doing this, and confirm that you've completed the required trust configuration). 

Pasted Graphic 18.png

Accessing the web app in SAP Build Work Zone

The link to the site can be found on the Site Directory.

LudoNoens_4-1714466297804.png

Depending on how you've configured your site in SAP Build Work Zone, it might look a bit different. But you should have the tile of your app visible on your site.

LudoNoens_5-1714466445212.png

Clicking on the tile will open our web app. Notice the SAP BTP authentication happening before opening the app. Also note that you can open the URL on any device; on mobile as well as desktop devices.

2024-04-30_16-59-11 (4).gif

In case you are wondering where the icon ended up: check your web browser's tab.

LudoNoens_3-1714476614589.png
Alternatively, you can also open the URL provided in SAP Build Apps, or find a link to your app in your subaccount, under the tab HTML5 Applications. 

LudoNoens_0-1714557961791.png

Summary – use case D

In this use case we have built and deployed our cross-platform app as a web app to SAP BTP. Building and deploying the app in the cloud is easy, as you don't need to install any tools on your local development machine.

SAP Build Apps deploys the application to the HTML5 Application Repository service. Using the web app, end users authenticate with IAS. Only users who have the correct Role assigned will be able to access the data provided in the CAP-based data service, which we can access through the BTP Destination.

Access to the app requires configuration of the Identity Authentication in the subaccount.

We have set up a simple business site in SAP Build Work Zone, to provide end-users easy access to the app.

And again, all the above was done without writing a single line of code.

What's next

In the next blog post, we will continue on the connectivity topic and connect to an S/4HANA system.