SAP Tutorial: Serving Data from an On Premise System in a CAP Java Application (Part 1)

Part 1: Setting Up a Destination on Business Technology Platform

Brian Heise
5 min readApr 1, 2021
Photo by Christian Wiediger on Unsplash

Contents

An increasingly common use case for SAP’s CAP framework is to serve data from an on-premise system. There are already several blogs that detail how to achieve this using CAP’s Node.js flavor, but I personally haven’t been able to find any that document the process end-to-end for Java. Therefore, in the following tutorial I’ll explain how to do this step-by-step.

Here in Part 1 I will explain how to define the connection to your on-premise system on Business Technology Platform and how to test to make sure that connection is working. You can find this information in other blogs, but in the interest of completeness for this series I’m writing my own version.

Prerequisites

To successfully complete this tutorial, you will need the following.

  • Access to an on-premise S4HANA system (1808 or above recommended)
  • A trial account on Business Technology Platform (find out how to get one here)
  • Cloud Connector installed in the on-premise system (find out how do that here)
  • Cloud Connector linked to your BTP account (find out how to do that here)

Step 1

Login to your BTP trial account. Once you enter, navigate to your subaccount by clicking on the card as shown below.

Step 2

Open Connectivity → Destinations on the sidebar on the left, as shown below.

Step 3

Click “New Destination”.

Step 4

Enter the following details.

  • Name: Anything you like, but please remember this! It will be very important in later steps.
  • Type: HTTP
  • Description: Optional, but it’s good to add some notes about which system you’re connecting too.
  • URL: This is the URL and port registered to your account in the cloud connector. This is not the standard URL and port of your on-premise system.
  • Proxy Type: On Premise
  • Authentication: BasicAuthentication
  • Location ID: This is only necessary if more than one cloud connector is registered to your account.
  • User: The username that you use to logon to your on-premise system. In other words, the same username that you would use to login to GUI or Fiori Launchpad.
  • Password: The password for the above username.

Step 5

To the right of the above inputs there’s a button labeled “new property”. Click it make additional inputs appear, and fill in the following details.

  • HTML5.DynamicDestination: true
  • HTML5.Timeout: Timeout in milliseconds
  • sap-client: The client you want to connect to on the on premise system.
  • WebIDEEnabled: true (This allows this destination to be reached from the Business Application Studio)
  • WebIDEUsage: odata_abap, dev_abap (These values allow the application to access oData resources and deploy applications to the on premise system)

Step 6

Click “Check connection” at the bottom of the screen to make sure all is well. Note that you may receive the following error message:

If so, don’t worry! This error is common and it doesn’t necessarily mean the connection isn’t working. We can go to Business Application Studio and generate a new Fiori application. That will allow us to check the connection as well.

Step 7

Login to your Business Application Studio account. If you don’t have one, follow these instructions to set one up.

Step 8

Start a new application from a template as shown below.

Step 9

Select “Fiori Application” and click “start”.

Step 10

Select “SAP Fiori Elements”, select “List Report Object Page” and click “Next”.

Step 11

Select “Connect to an SAP System, then select the destination that you registered, then select an oData service. If you were able to see the list of oData services, then your destination is working correctly.

If your screen does not look like the one above, but instead looks like the one below, then it means there is either an error in your destination definition or in the settings for your account in Cloud Connector.

Go back and check your settings and if everything is correct, then contact the person in charge of your Cloud Connector.

--

--

Brian Heise
Brian Heise

Written by Brian Heise

Full Stack web developer employed at Liferay Japan

No responses yet