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: 
CarlosRoggan
Product and Topic Expert
Product and Topic Expert
0 Kudos

Part 4 : Connect the Cloud


 

 

--
Advertisement:
--  -- No cloud expertise required -- --
--


 

 

Over-View


Part 1: Preparation
     * 360°-View
     * Pre-View
     * Quick-View on Prerequisites
     * Service-Oriented View
Part 2: Create the Annotation Model
     * Background
     * Create Project
     * Reference the Gateway Service
     * Reference the vocabulary
     * Create the Annotation Model
     * Runtime Artifacts
Part 3: Explore the Annotation Model
     * ABAP-View
     * Model-View
     * XML-View
     * Post-View

Part 4: Connect the Cloud (this blog)
     * Intro
     * Prerequisites
     * SAP HANA Cloud Connector
          ** Download
          ** Install
          ** Start
          ** Configure 1
          ** Configure 2
          ** Verify
     * Appendix
          ** Access HCP trial
          ** Tip: Avoid SSO

Part 5:  OData provisioning
     * Find it
     * Configure it
          ** Assign Roles
          ** Create Destination
     * Register Service
     * Summary
Part 6: The Fiori Application
     * Intro
     * Create destination pointing to OData provisioning in HCP
     * Generate application
     * Run the application
     * Summary
Part 7: Trouble-Tips



 

 

Intro


 

This is the 4th part of the end-to-end tutorial which explains how to create a UI5 application based on Smart-Templates, running in the cloud on top of OData provisioning, which exposes an OData service and standalone annotations.

The UI5 application (Fiori) is based on an OData service (in terms of data to be displayed) and is defined via annotations (in terms of UI elements).

In Part 1 of this tutorial, we’ve chosen an OData service (GWSAMPLE_BASIC) and we’ve created the annotations in part 2 and 3.

So until now we’ve been working in the SAP NetWeaver system. That’s the on-premise backend which contains all the business data and facilitates its exposure to the outside world via an SAP Gateway service (OData). It also allows to create and host the annotations for that service.

In the present 4th part of the tutorial, we want to bring it all to the cloud: both the OData service and the annotation model have to be available in the cloud in order to create and run the Fiori application in the cloud.

With other words:

We want to use the SAP HANA Cloud Platform (HCP) to create the application and benefit from all the advantages.

With even more splendid words:

Connecting the backend to the cloud is easy.

 

The SAP HANA Cloud Platform (HCP) supports you in creating and running and maintaining onDemand applications in the cloud.

 

For example, you can create a Fiori-style HTML5 application and run it in the cloud, and this app interacts with data that is located on an SAP Backend

And that's exactly what we're doing in our tutorial.

 

Before we start, we have to understand:

"The Cloud" and "The Backend" are 2 well separated worlds.

 

In order to connect them, we need a special tool: the SAP HANA Cloud Connector (HCC)

This is the first step that we're going to do in the present blog

 

After having installed the HCC, we're able to access the backend from the cloud.

More precise, what we want to access is the concrete SAP Gateway service and the annotation model.

This is facilitated by OData provisioning in HCP, the second section of the present blog.

 

We are here:

 



 

 

Prerequisites


No skills required.

You only need access to the SAP HANA Cloud Platform.

If you don’t have, you just need to follow the few steps to get free access to the free SAP HANA Cloud Platform trial account.

A detailed description can be found in the Appendix section at the end of this blog.

Before installing the SAP HANA Cloud Connector, you should logon to your HCP account, to have the details ready.

 

SAP HANA Cloud Connector


 

Note:

I’m guiding you through the steps that I did. The real documentation of the SAP HANA Cloud Connector (HCC) can be found here

 

Download the HCC

Go to https://tools.hana.ondemand.com

Click on “CLOUD”

Scroll down to section “SAP HANA Cloud Connector”

Choose your operating system and download the corresponding package.

In my case, it is the following:

https://tools.hana.ondemand.com/additional/sapcc-2.8.0.1-windows-x64.zip

 

Save the zip file at your local file system.

 



 

Install the HCC

After download, extract the zip file to a directory of your choice.

And that's already all that you have to do for the installation.

 

Start the HCC

Open a console window

Navigate to the root installation folder.

Execute go.bat

Check the output on the console window

After short time, a success message is displayed in the console window.

Now you can open your favorite Chrome browser and go to https://localhost:8443/

The login screen is displayed where you can login with the default user (Administrator) and initial password (manage)

 

Configure the HCC to connect to HCP

After login, you have to go through the initial configuration.

In this case, initial configuration means to connect the HCC to a cloud account.

The HCC can be used to connect to multiple accounts, and the first connection is done through a wizard after the first login.

While following the initial configuration, enter the following details:

Choose Master

Change the initial password to a password of your choice.

Remember your new password.

Enter the following details for the initial configuration:

 

Landscape Host: choose hanatrial.ondemand.com

Account Name: enter the name of your account.

If you aren’t sure, check the Appendix section for the exact location where you can find your account name.

If you’ve registered for a free trial, the account name probably starts with “p” followed by a number and by “trial”

Display Name: enter a name e.g. personal trial account for public HANA cloud

Account User: that’s the user that you’re using when logging into HCP.

If you’ve registered for a free trial, the user name probably starts with “p” followed by a number

(note: the user name doesn't have the suffix "trial")

Password: that’s the password that you’re using when logging into HCP (not the HCC password)

In case you’re using cloud in corporate network and you’re logged in via SSO, then you might not now your password

In such case, you can check the Appendix section for a tip, personally from my side and exclusively for you.

Proxy settings: (here I cannot help you, so I better don’t write anything)

Connector Info: Enter a description of your choice for your locally installed HCC.

It should be such a description that you’ll recognize later.

 



 

 

Note: you can only connect one (master-) HCC to your account

Once you’re done, press “Apply”

After the initial configuration you have connected your local SAP HANA Cloud Connector to your HCP account.

Bravo!

 

Under the hood, your local Cloud Connector has talked to the HCP and has registered itself there.

...Yes...really.

You can check it:

Go to your HCP account.

Click +Connectivity->Cloud Connectors

On the right pane you see the cloud connector that you’ve just installed and connected (you recognize it by the description)



 

OK, now we’re able to talk from the HCP to the HCC.

Fine.

BUT: we're NOT yet able to talk from the HCC to the SAP NetWeaver backend system.

So the next thing to do is to configure the HCC such that it can talk to the backend. We have to add some backend info

 

Configure the HCC to connect to a backend

So now we have to configure the HCC to connect to a SAP Netweaver backend.

More specifically: we want to call a SAP Gateway service, that's a special configuration setting.

Change to the cloud connector browser window (https://localhost:8443 )

In the navigation pane, click on “Access Control”.

On the right pane, we can enter the SAP backend system.

 

Note:

The SAP backend system that we want to connect to the cloud, is referred as “Internal System”.

The reason is that we can provide an alias for the backend system. This allows to hide the real name, such that the users in the cloud cannot see the real name.

 

Click “Add” , then choose “SAP Gateway” as Back-end Type.

 



 

Click “Next” and choose HTTPS, then enter the host and port of the backend system.

You should know this data, as it is the same like you use when invoking a Gateway service

 



 

Click next and enter the alias, if desired.

 

Note: this alias is the name as it will appear in the HCP.

 

For your personal trial account, you don't need to use a different alias name, you can just copy&paste the same values, it will make life easier, since it is only meant for tryout purpose, so you don’t have to hide anything of yourself.

 

Press “Next” and don’t change the default for Principal Type (None), press “Next” and “Next” and “Finish”

 

Now that we have a added backend, there's one more setting required:

We have to allow access to resources on that backend.

Select the new entry in the table and in the lower pane “Resources Accessible On…”, click on “Add”

In the popup, enter a forward slash as URL Path and enable the check-box “Path and all sub-paths”

This is the quick way of allowing overall access.

 


Note:
Of course, this is not the professional and secure way of configuring.
More likely, you would add the ICF node which is relevant for OData provisioning:
/sap/iwbep/

 

Press “Save”

It makes sense to execute a “check” for the newly configured backend.

At the end, after successful check, the page looks like this:

 



 

Finally, we can check the “Connector State” on the left navigation pane.

Then we can see that there are no “Cloud Connections (0)” for our configured account in our cloud connector.

Don't wonder: once we’ve created a destination in the cloud, that number will increase.

We’re done with the cloud connector set up.

 

Verify the Cloud Connector in HCP

 

In our HCP account, we can now see that the "Cloud Connectors" page has an entry in the “Exposed Backend Systems”

 



 

At this point, we’ve reached our target:

From HCP we can connect to the HCC and from HCC we can connect to the SAP backend.
This means that applications that run in HCP can fetch data from the SAP NetWeaver backend system.

 

...That’s good to hear:

“applications can fetch data from backend”

 

...But... could it be described more precisely, please?

 

In HCP, there’s the concept of “Destinations”. A destination is a kind of placeholder for a remote host. In your HCP-application, you don’t use the full URL of a remote connection. Instead, you create a destination that points to the remote host and in the application, you use the destination-placeholder and append the desired relative URI.

That’s how I understand it.

The “professional” documentation of the Destination concept can be found here

Note:

In our case, the “remote host” is the alias that we’ve defined above in the Cloud Connector configuration section.

 

...Why all this explanation?

For connecting to our SAP NetWeaver backend which we used in tutorial part 1, we have to create such a destination.

This will be explained in the next chapter, just a few more words.

 

A destination can be created and be made available on different levels (see documentation link above) which has an impact on the visibility.

For example, when you login to your HCP-account, you have the navigation pane on the left side, and there you have the menu entry

Connectivity – Destinations.

There you can define destinations and they can be used by all applications that run in your account. However, if you want to define destinations which should be visible only for one application, then you have to create the destination on application-level. Means, an application has its own configuration section.

 

Let’s recall what we’re doing here at all:

In the backend, we have a Gateway service and annotation model. We want to access it from HCP.

 

For this purpose, in HCP there’s a standard offering: the OData provisioning (ODP).

It allows to register Gateway-services in HCP.

In HCP, the ODP is offered as a service.

In my personal brain, I always think of it as cloud-service, in order to distinguish from OData-service. Just my personal tip.

You can think of it also as “OData-provisioning-as-a-service” in HCP. HCP is the platform-as-a-service.

 

OK, what I wanted to point out: the OData provisioning has its own configuration section, and there we’ll create our destination.

 

Good.

We have talked a lot about connectivity, now we can go ahead and work with HCP OData provisioning in the next Blog.

 

 

Summary

In this part of the tutorial, we’ve learned how to access the SAP HANA Cloud Platform (HCP) and how to connect from the cloud to the onPremise SAP NetWeaver backend system

For this purpose, we’ve installed and configured the SAP HANA Cloud Connector (HCC).

From now on, we can create destinations in HCP in order to connect to the backend system

 

In the next blog, we'll learn how to create such a destination and how to use OData provisioning.

 

 

 

Appendix


 

Get free access to HCP


 

Itis a quick and simple registration.

I promise...

 

 

In order to register for a free developer trial account in SAP HANA Cloud Platform (HCP), go to  https://hcp.sap.com

Click on “Sign up for a Free Account”

 



 

 

On the next page https://hcp.sap.com/try.html click on "Try now".

 

 



 

You’re taken to the logon screen.

Since you aren’t yet registered, you have to click “Register”

 



 

On the Registration screen, enter your personal information.

Note that the E-mail address has to be valid, you’ll receive a mail in order to confirm the registration.

 

 



 

 

After pressing "Register", you’ll receive the e-mail, for confirmation.

So you have to check your mailbox of the e-mail provided above.

In the mail you’ll find a link, click it and it takes you directly to the login page for the trial account of HCP

 



 

Click "Log On"

You might receive a “News and Announcements” popup, which you can close.

That’s it – YOU’RE IN THE CLOUD !!

 

And this is your elevator-door into the cloud:

https://account.hanatrial.ondemand.com

 

Ehmm...Now that you’re in… WHAT NOW?

 

 

Explore the HCP cockpit

 

After logging in, you’re in the cockpit, in the upper menu, you can see the Data Center and your account

 



 

The dashboard is the first entry point, where you have access to lots of information resources.

 



 

You can create a Java application using the Eclipse IDE and the cloud SDK, then deploy it to the cloud. This Java application will then be listed in the “Java Applications” screen.

You can create a Fiori-style HTML5 application using the SAP WebIDE, then deploy it to the cloud. This HTML5 application will then be listed in the “HTML5 Applications” screen

 

Subscriptions

You can view subscriptions.

What is a subscription?

Instead of having an own instance of an app, the app is hosted in a central SAP account and you subscribe for it. There’s only one instance (virtual) and all cloud users use it.

An example:

Click on “Subscriptions”, then you can see that one subscription is already there: the SAP WebIDE is provided for free in the trial account.

You can see that there’s a central “Provider Account” and that it hosts the application with name “webide”.

You can click on the link to see the details of the subscribed application (in this case: “webide”)

There, you can find the link to start the application. Click it and the SAP WebIDE starts in an additional browser page.

Note: if you check the application URL, you can see that it starts with the name of the subscribed application, then a hyphen, then the account name.

 

Services

In the cloud, functionality can be offered as a “service”, for example access to a database, etc

In the list of services, you can see for example the SAP Web IDE, which is enabled as per default.

One of the services available in the HCP trial is “HCI OData provisioning”. This is the one that we will be using in this tutorial

 

 

Tip: avoid SSO


What to do if you don’t know your PW because you’re always logged in via SSO?

Proceed as described below to get to the desired Log On screen of HCP, where you can request a new password.

Firefox: Options->Advanced

Or enter the following URL in Firefox: about:preferences#advanced

In the "Requests" section, mark the radio-button Ask me every time

 



 

After changing the setting, go to the HCP-URL.

certificates-popup is displayed

Press “Cancel”,

then the logon-page is displayed

Here you can enter your password or request a new one.

 

 

 

 

--


Advertisement


-- -- Stay tuned and you’ll be in the cloud -- --


--