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.
Showing results for 
Search instead for 
Did you mean: 

The SAP HANA Cloud Platform is a development platform based on open standards. The platform provides developers with the flexibility to use frameworks/tools of their choice for application development. Let's take the case of developing the user interface. While SAP UI5 is SAP's recommended client side framework for developing business applications, HCP provides the flexibility of using any HTML5/JavaScript based framework like ReactJS, AngularJS, Bootstrap.

In this blog, we will develop an HTML5 application on HCP using:

  • Angular JS as the client side framework that helps in development of UI applications by providing MVC/MVVM features,data binding etc.
  • The Northwind OData service as the back-end service for fetching data (of course any RESTful APIs or web services can be used here, not necessarily  OData services).
  • Bootstrap as the client side framework for styling the application.


  • You should have an HCP developer(trial) account to execute the steps mentioned below.
  • You should be familiar with basics of developing HTML5 applications,AngularJS and Bootstrap.

  • The source code for this application is available at Github. You can follow instructions provided at Github to import and run the application in your HCP trial account.
  • While you can use the IDE of your choice(for e.g Eclipse with Angular JS plugins) for developing an HTML5 application on HCP, we will build this application using the SAP Web IDE which is available as a service on HCP.

Step 1: Create a simple HTML5 application using the SAP Web IDE

  • Using the SAP Web IDE, create a new HTML5 application. Right click on the Workspace node, select the New > Folder menu. Provide the Folder Name as "angularnorthwindapp".
  • Create the app descriptor file. Right click on the angularnorthwindapp node, select the New > File menu. Provide the File Name as "neo-app.json".
  • Insert the following content into the neo-app.json file and save it.


  "welcomeFile": "index.html"

  • Create a file by name "index.html". Insert the following content and save.


<!DOCTYPE html>
<h1>Hello World from HCP</h1>

  • Preview the application by hitting the Run button(or press Alt+F5). You should see a "Hello World" text in the Preview page.

Step 2: Hello HCP from AngularJS!

Next we will add some AngularJS code into the application.

  • Bootstrap AngularJS into the application by adding the following script tag into the index.html.


<script src = ""></script>

  • Replace the content of the index.html file with the content below and save. Here the ng-model and ng-bind directives provided by AngularJS for data binding are used.


<!DOCTYPE html>
<script src = ""></script>
<div ng-app="nwApp">
<p>Input something in the input box:</p>
<p>Name: <input type="text" ng-model="name"></p>
<p ng-bind="name"></p>

  • Refresh the Preview page. Enter something in the input field(For e.g. 'Hello HCP from AngularJS') and you should see it appear as a text below due to the data binding capabilities of AngularJS.

Step 3: Fetch data from the OData service

Next step is to fetch data from the back-end by making an HTTP GET call to the Northwind OData service. This will be done using HTTP destinations in HCP.

  • Create a destination file for the northwind service in the HCP cockpit.


Description=Northwind OData Services

  • Add a route for the northwind service destination by inserting the following code into the neo-app.json file.


  "welcomeFile": "index.html",
   "routes": [
      "path": "/destinations/northwind",
      "target": {
        "type": "destination",
        "name": "northwind"
      "description": "northwind"

  • To keep the business logic separate from the UI, create a file named "main.js" under the angularnorthwindapp folder. Insert the code from below.
  • This code makes an AJAX call to the northwind service using the $http service from AngularJS. Note that the northwindURL uses the /destinations/northwind/ path defined in the neo-app.json file.
  • The response from the server is processed and added as an array of invoices to the $scope object (provided by AngularJS). This will be used for data binding in the UI in the next step.


angular.module("myapp", []).controller('NorthwindController',['$scope','$http', function($scope,$http) {
         var northwindURL='/destinations/northwind/V4/Northwind/Northwind.svc/Invoices?$top=15';
              method: 'GET',
            }).then(function successCallback(response) {
            var results =;
            var invoices=[];
    var invoice={};
    invoice.product =  result.ProductName;
    invoice.unitprice =  result.UnitPrice;
    invoice.quantity= result.Quantity;
    invoice.totalcost = invoice.unitprice*invoice.quantity;
      }, function errorCallback(response) {
      alert("Error while fetching invoices"+ response);

  • Include the main.js file in the index.html


<script src="main.js"></script>

  • Bind the data to the UI by looping through the invoices object using the ng-repeat directive.


<body ng-app = "myapp">
          <div ng-controller = "NorthwindController" >
            <div class="container">
                  <div ng-repeat="invoice in invoices">
                    <h3>{{invoice.quantity}} X {{invoice.product}}</h3>

  • Refresh the Preview page. At this point, you should see the invoices on the page with no formatting/styling. Understandably the next step is to add some styling to the UI.

Step 4: Style the application using Bootstrap

  • Firstly, bootstrap Bootstrap :smile: by adding the script tags for Bootstrap and jQuery(Bootstrap has a dependency on jQuery).


<script src = ""></script>
<script src=""></script>
<link rel="stylesheet" href="">

  • Use the basic table CSS classes from Bootstrap to style the table.


<div ng-controller = "NorthwindController" >
            <div class="container" style="margin-top:80px;">
              <table class="table table-hover table-bordered" style="margin-top:30px">
                    <th>Unit Price</th>
                    <th>Total Cost</th>
                  <tr ng-repeat="invoice in invoices">
                    <td>{{invoice.quantity}} X {{invoice.product}}</td>

  • Refresh the Preview page. You should see a page with a table of Invoices as shown below:

Step 5: Activate the application to make it accessible via a public URL

  • Deploy the HTML5 application to HCP by right-clicking on the angularnorthwindapp and selecting Deploy > Deploy to HANA Cloud Platform. In the Deploy Application dialog, leave the defaults and click on the Deploy button.
  • In the Successfully Deployed dialog, click on the 'Open the active version of the application' link. You should see the same page as above, with a public URL(available on the internet) that can be shared.
  • The deployed application would be accessible on the following URL:

Note: Replace pXXXX with the SCN User ID that you provided during registration.

And you're done! You have a basic AngularJS application running on HCP.