Skip to Content

Dear All,

While working with Cloud Connector , I faced difficulties to look for some guidance in a single place to refer. Hence, decided to put everything here as a Guide Book for the Beginners which includes the installation steps, post installation configuration and developing a simple application.

1. Overview

SAP HANA Cloud connector connects between on-demand applications in SAP HANA Cloud Platform and existing on-premise systems. The Cloud connector runs as on-premise agent in a secured network and acts as a reverse invoke proxy between the on-premise network and SAP HANA Cloud Platform.

Due to its reverse invoke support, the configuration is not required in the on-premise firewall to allow external access from the cloud to internal systems. The Cloud connector provides control over:


  • On-premise systems and resources (HTTP or RFC) that shall be accessible by cloud applications.
  • Cloud applications that shall make use of the Cloud connector.

                    /wp-content/uploads/2015/07/1_746012.jpg

1.1. Advantages


Compared to the approach of opening ports in the firewall and using reverse proxies in the DMZ to establish access to on-premise systems, the Cloud connector has the following advantages:

  • In order to establish connectivity from SAP HANA Cloud Platform to an on-premise system, the firewall of the on-premise network does not require to open an inbound port.
  • The Cloud connector supports HTTP and RFC protocols as of now. For example, the RFC protocol supports native access to ABAP systems by invoking function modules.
  • The Cloud connector can be used to connect on-premise database, or BI tools to SAP HANA databases in the cloud in both direction
  • The Cloud connector is easy to install and configure, that is, it comes with a low TCO and fits well to cloud scenarios. SAP provides standard support for it.


2. Step by step process to Install Cloud Connector

This document illustrates the step by step installation process of Cloud connector 2.x on Microsoft Windows OS.


2.1. Prerequisites

Below are the prerequisites for successfully installation of Cloud Connector 2.x.


2.1.1. Hardware

  • Memory: 1 GB RAM (min.), 4 GB recommended
  • Hard disk space: 1 GB (min.), recommended 20 GB
  • CPU: Single core 3 GHz (min.), dual core 2 GHz recommended, x86-64 architecture compatible
  • 64-bit operating systems: Windows 7, Windows 8.1, Windows Server 2008 R2, Windows Server 2012, or Windows Server 2012 R2.
  • Cloud connector installation archive from SAP Development Tools for Eclipse.
  • Microsoft Visual Studio C++ 2010 runtime libraries.
  • Supported JDKs version : 6,7
  • Environment variable for <JAVA_HOME> has been set to the Java installation directory, so that the bin subfolder can be found.


2.1.2. Software

  • 64-bit operating systems: Windows 7, Windows 8.1, Windows Server 2008 R2, Windows Server 2012, or Windows Server 2012 R2.
  • Cloud connector installation archive from SAP Development Tools for Eclipse.
  • Microsoft Visual Studio C++ 2010 runtime libraries.
  • Supported JDKs version : 6,7
  • Environment variable for <JAVA_HOME> has been set to the Java installation directory, so that the bin subfolder can be found.


2.2. Setup the Required Software

2.2.1. Downloading Cloud Connector Installation Archive

                   /wp-content/uploads/2015/07/1_746012.jpg

  • Download the msi file from “SAP HANA Cloud Connector” Section.

                    /wp-content/uploads/2015/07/1_746012.jpg


      

2.2.2. Setup the Environment Variable

  • Create Environment Variable JAVA_HOME and update the directory path

     /wp-content/uploads/2015/07/1_746012.jpg

2.3. Installation

  • Double click on the <sapcc-<version>-windows-x64.msi> installer file.

   /wp-content/uploads/2015/07/1_jpg_745980.png

  • Having downloaded the cloud connector MSI installer to start the installation by double-clicking the MSI. Afterwards it will be welcome by the installer.

  /wp-content/uploads/2015/07/1_746012.jpg

  • Navigate to the installation directory for the SAP HANA Cloud connector and choose Next>.

   /wp-content/uploads/2015/07/2_746013.jpg

  • Port can be chosen on which the administration UI is reachable. Either leave the default 8443 or choose a different port if needed. Then choose Next>.

   /wp-content/uploads/2015/07/3_746016.jpg

  • On this step, decide whether the Cloud connector should be started immediately after finishing the setup. If this is not required now, remove the check from the checkbox. Then choose Next>.

   /wp-content/uploads/2015/07/1_746012.jpg

  • After all installation options have been fulfilled, to start the install, press again the Next> button.

   /wp-content/uploads/2015/07/2_746013.jpg

  • In up to a few seconds, the installation has been done. To finish the installer, choose the Close button.

      /wp-content/uploads/2015/07/3_746016.jpg

Note: As the cloud connector is registered and started as a Windows Service, we can start it later within the Administrative Tools/Services administration tool of Windows (service is named SAP HANA Cloud Connector 2.0), if we decide not to start it immediately. There, we can also do restarts of the service whenever this is needed.

 

3. Post Installation Configuration

3.1. Establish connection to the cloud account

               Now we connect the freshly installed cloud connector to the HCP developer account.


Logon to the cloud connector administration UI by invoking the URL https://localhost:8443 in a Web browser. The cloud connector logon screen then is shown in the browser. As user and password, use the pre-defined user Administrator and password manage.


As we have installed the Cloud connector on our IDES, the URL would be

https://<ip address>:8443


/wp-content/uploads/2015/07/1_746012.jpg

  • As first step, select Master (Primary Installation) as the installation type. The other choice Shadow (Backup Installation) is used for a high availability installation of the cloud connector and not used in this context.

   /wp-content/uploads/2015/07/2_746013.jpg

  • After the first logon, the initial password needs to be changed.

   /wp-content/uploads/2015/07/3_746016.jpg

  • As next step, we need to connect the cloud connector with our developer account in the cloud. Make sure to select hanatrial.ondemand.com as Landscape Host, and specify our free developer account as Account Name.
  • In case the cloud connector is located within a fenced corporate network that allows connectivity to internet resources only via a proxy, also specify the HTTPS proxy.

/wp-content/uploads/2015/07/4_746017.jpg

  • Now the main page of the cloud connector administration UI shows up. In case the connection succeeded, we will see the Connector State with a yellow indicator as shown in the following screenshot. Now, we have a persistent SSL connection to our cloud account and are ready to use this connection in our cloud applications.


                    /wp-content/uploads/2015/07/5_745991.jpg

4. Step By Step Guide of a Sample Application Development

4.1. Business Scenario

This will be a simple sum calculator of two numbers. There will be a web url through which user will pass 2 numbers and will get the result as summation of the two given input.


The summation logic will be written in a Function Module in IDES system(SAP ECC on-premise) and will be called from HANA Cloud through Cloud Connector. The java web application will be deployed and hosted on the Hana Cloud Platform and call the Function Module via the Cloud Connector.


4.2. Function Module in ECC

A sample Function Module – “ZDEMO_CAL_HCC” is written to sum of two numbers which are taking as input and result will be exported as output.

  • Make sure Remote Enabled Function Module is clicked.
  • Make sure to click on Pass Value for both the Import and Export parameters.

          /wp-content/uploads/2015/07/1_746012.jpg

        /wp-content/uploads/2015/07/1_746012.jpg

       /wp-content/uploads/2015/07/2_746013.jpg

       /wp-content/uploads/2015/07/3_746016.jpg

4.3. Cloud Connector Configuration – Configure the on premise resources

Login to the Cloud Connector and Click on the Account Dashboard. It is observed that the account in Hana trial is already connected with a green status. We can add more accounts using add button.

       

/wp-content/uploads/2015/07/4_746017.jpg

4.3.1. Exposing Intranet  Systems

To allow the on-demand applications to access a certain back-end system on the intranet, this can be managed using the Cloud connector access control management.


     1. Go to the Access Control tab page and Choose Add.

     2. Internal Host and Internal Port specify the actual host and port under which the target system can be reached. It needs to be an existing network            address that can be resolved on the intranet and has network visibility for the Cloud connector without any proxy.

     3. Virtual Host specifies the host name exactly as it is specified as the URL property in the HTTP destination configuration in SAP HANA Cloud Platform.           The virtual host can be a fake name and does not need to exist.

     4. The Virtual Port allows distinguishing between different entry points of the back-end system.

/wp-content/uploads/2015/07/1_746012.jpg

4.3.2. Limiting the Accessible Services

In addition to allowing access to a particular host and port, specifying which function modules (Resources) are allowed to be invoked on that host. All other RFC requests are denied by the Cloud connector.


     1. To define the permitted function modules (Resources) for a particular back-end system, choose the row corresponding to that back-end system. A                     dialog appears, prompting to enter the specific function module name to allow.

/wp-content/uploads/2015/07/4_746017.jpg

     2. The Cloud connector checks that the function module name of an incoming request is exactly as specified in the configuration. If it is not, the request is               denied.

     3. If selected the Prefix option, the Cloud connector allows all incoming requests, for which the function module name begins with the specified string.

     4. The Enabled checkbox allows to specify whether that resource should be initially enabled or disabled.

/wp-content/uploads/2015/07/2_746013.jpg

4.4. Hana Cloud Configuration – Destination

Connectivity destinations are part of SAP HANA Cloud Platform connectivity service and are used for the outbound communication of a cloud application to a remote system. They contain the connection details for the remote communication of an application.


Connectivity destinations are represented by symbolic names that are used by on-demand applications to refer to remote connections. The connectivity service resolves the destination at runtime based on the symbolic name provided. The result is an object that contains customer-specific configuration details, such as the URL of the remote system or service, the authentication type, and the relative credentials.


The currently supported destination types are HTTP, Mail and RFC.


  • HTTP destination– provides data communication via HTTP protocol and is used for both Internet and on-premise connections.
  • Mail destination – specifies an e-mail provider for sending and retrieving e-mails via SMTP, IMAP and POP3 protocols.
  • RFC destination – makes connections to ABAP on-premise systems via RFC protocol using JCo as API.

Here, the steps to create the RFC destination type


     5. Open the HANA Cloud Platform Cockpit

     6. Click on Destination.>New Destination

     7. Create the Connection as Dest_Connector

/wp-content/uploads/2015/07/1_746012.jpg

4.5. Develop Application

SAP HANA Cloud Platform applications can be based on the Java EE Web application model and hence can develop applications for SAP HANA Cloud Platform just like for any application server.


Next steps are the process to develop the Application which will call the RFC in ECC.


4.5.1. Creation of a Dynamic Web Project

     8. Open the Eclipse IDE for Java EE Developers and switch to the Workbench screen.

     9. From the Eclipse IDE main menu, choose File New Dynamic Web Project .

     10. In the Project name field, enter the name of the Project.

     11. In the Target Runtime pane, select the runtime to use to deploy this Project application. Here we are using “SAP HANA Cloud”

     12. In the Configuration pane, use the default configuration.

     13. Choose Finish.

/wp-content/uploads/2015/07/1_746012.jpg

4.5.2. Creation of a Servlet

     1. On the DemoCalculator project node, open the context menu and choose New Servlet . Window Create Servlet opens.

     2. Enter the package and class name.

/wp-content/uploads/2015/07/1_746012.jpg

     3. Choose Finish to generate the servlet. The Java Editor with the ConnectivityRFCDemo opens.

     4. Change the doGet(…) method so that it receives the input from user, call the Function Module using the Destination created in HCP and result back to               the user with the output.

     5. Save the changes.


Java Code: Attached in the file named “code.txt”



4.5.3. Creation of a JSP Page

     1. Explore the DemoCalculator Project node, on the WebContent node, right click and choose New JSP File . Window Create JSP File opens.

     2. Create two JSP File, one for the input of two numbers and another for the output file.

     3. Here the two JSP file named Calculator.jsp and Result.jsp.


/wp-content/uploads/2015/07/1_746012.jpg

  4. Code for Calculator.jsp:


               /wp-content/uploads/2015/07/1_746012.jpg

     5. Code for Result.jsp:


               /wp-content/uploads/2015/07/2_746013.jpg

4.6. Deployment

     1.       Open the servlet in the Java editor and from the context menu, choose Run As Run on Server .

     2.      The Run On Server dialog box appears. Make sure that the manually define a new server option is selected.

     3.      As server type, select SAP SAP HANA Cloud Platform .

     4.      For Server’s host name, use the landscape host depending on the account type. As we are using Hana Trail account, we are using                hanatraial.ondemand.com

/wp-content/uploads/2015/07/1_746012.jpg

     5.      Choose Next.

     6.      On the New Server wizard page, specify the application name as mycalc (only lowercase Latin letters and digits are allowed).

     7.      From the Runtime dropdown box, select a specific runtime. If the Automatic option is selected, the server will load the target run-time of the application.

     8.     Enter the account name, user name, and password.

     9.      Choose Finish. This triggers the publishing of the application on SAP HANA Cloud Platform.

     10.    After publishing has completed, the Internal Web Browser opens and shows the application.

/wp-content/uploads/2015/07/2_746013.jpg


11.   Once it is deployed on the HANA Cloud Platform, it can be monitored from the HCP Cockpit.

/wp-content/uploads/2015/07/3_746016.jpg

/wp-content/uploads/2015/07/4_746017.jpg

4.7. Test

Once the application is deployed in the HANA Cloud Platform, we can get the url from the HCP Cockpit to test it from the Browser.


Here for our case, the url is: https://mycalc>account number>trial.hanatrial.ondemand.com/DemoCalculator/Calculator.jsp


/wp-content/uploads/2015/07/1_746012.jpg

/wp-content/uploads/2015/07/2_746013.jpg

/wp-content/uploads/2015/07/3_746016.jpg

To report this post you need to login first.

27 Comments

You must be Logged on to comment or reply to a post.

  1. Ulrich Schmidt

    Nice summary!

     

    Let me just add a few comments:

    The Cloud connector can be used to connect on-premise database, or BI tools to SAP HANA databases in the cloud in both direction

    Accessing a HANA DB in the Cloud from an on-premise SQL studio is built into the SCC. However, for the other direction (accessing an on-premise database from a Cloud App) more work is required. One way to do it is to install an additional SAP Business Connector next to the database and use it to translate the SQL/JDBC based protocol to HTTP. The details are outlined in the following document: http://scn.sap.com/docs/DOC-28581. (This document describes as an example how to call an RFC module in the backend, but it can be used for all kinds of other scenarios as well, like accessing an on-premise database, or an FTP server, an MQ Series system or an EDI subconverter… Basically every system, that the SAP Business Connector can communicate with, can be accessed that way.)

     

     

    2.1.2 Software

    I know you are limiting this example to Windows, but I just want to mention that the SCC is also available for Linux and MacOS.

     

     

    Environment variable for <JAVA_HOME> has been set to the Java installation directory, so that the bin subfolder can be found.

    Additionally, on Windows the SCC is also able to find a Java installation from the Registry, e.g. the Registry Key “HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\CurrentVersion”. This key is usually created by the Java installation. If it points to an up-to-date Java 6 or 7 installation, the SCC will use it.

    By the way, there is one mistake in your screenshot: if you use the environment variable JAVA_HOME, then it should not include the “bin” subdirectory! Otherwise it won’t find the required files. The variable should be set to the parent directory, e.g. C:\Program Files\Java\jdk1.6.0_45 in this case. (If the SCC still runs in your example, then it probably uses the JDK found in the Registry… )

     

    Also, if you have the choice, I would recommend Java 7. The SCC still works with Java 6, but it is to be expected that in the future it will require Java 7. So it is a good idea to switch to Java 7 already now. (Java 8 still has incompatibilities with the SCC.)

    (0) 
    1. Prasana Ravichandran

      Hi Ulrich,

      Thanks a lot for the additional info.

      In one of our IoT demo we have a scenario to get the sensor values (from a remote weight sensor device) and need to send these values to a remote HANA DB (not the one attached with SAP HCP) .

       

      I couldn’t resolve this or no lead on how to do this. If you experts could shed some light on how to do this !

       

      Warm Regards,

      Prasana Ravichandran

       

       

      (0) 
      1. Anton Levin

        Please, familiarise yourself with the Community Rules of Engagement https://www.sap.com/community/about/rules-of-engagement.html and especially #9 – do not cross post. You have already asked opened a new thread here https://answers.sap.com/questions/164953/sap-hcp-iot-service-connecting-sensor-device-and-s.html

        Regards, Anton (Moderator)

        (0) 
  2. Bijayant Jha

    Hi Abhardeep Basu,

    it is a great document for beginners, in this document you had provided the way to connect to SAP system but would please provide me some information if I have to connect to XSOData from hana system to fiori app in web ide where I am using proxy IP address to access my xsodata, fiori app and back end data.

     

    Thanks

    Bijayant Jha

    (0) 
  3. madhav poosarla

    Hi Abhardeep Basu,

     

    i have gone thru the sizing requirement provided by you to connect setup CC,

    we are planning to implement CC between HCI and PO.. i would like understand would there be any changes in case if we have huge data (message sizes/ number of messages) that is being transferred between HCI and PO

     

    -Madhav

    (0) 
    1. Abhradeep Basu Post author

      Hi Madhav,

       

      I don’t think that will be a fare decision to place CC in between HCI and PO where these (HCI and PO) can be connected without using CC itself.

       

      Regards,

      (0) 
  4. Angelica Peñas

    Hi Abhradeep Basu,

     

     

    First, I would like to thank you for this document, very beginner friendly But I am having a problem regarding the submit button, after i had click it, it will show this

     

     

    HTTP Status 404 – /DCalculator/ConnectivityRFCDemo

     

     

    Can you help me? Thank You!

     

     

    -Jeka

    (0) 
    1. Ulrich Schmidt

      Hi Jeka,

       

      the comments to this document should only relate to the document. For support requests and problem reports I suggest that you open your own discussion thread in the Cloud Platform Developer Center forum.

      In order to trouble-shoot your problem you will probably have to describe your setup, network & proxy settings etc. in a bit more detail and attach logs & traces of the Cloud Connector and of the HCP app. All this is not related to this document here and would clutter the comments section…

       

      Best Regards, Ulrich

      (0) 
  5. Dennis Streichert

    Hey colleagues,

     

    thanks for the guide.

     

    I’ve following problem:

     

    On step 3.1 (Login into Cloud connector with Administrator and manage) fails.

    The message

    ‘User authentication failed’ appears.


    Could someone help me please?


    Thanks.

    (0) 
      1. Biral Gajjar

        Hallo Ulrich,

         

        Thank you.

         

        As I don’t have JAVA Quota in HCP,i couldn’t execute the above example.I would like to test Cloud connector  on premise System with data storage or some other example.?Any Suggestion please.

         

        Regards

        (0) 
  6. LUIGI FOSSATI

    Hi Abhardeep Basu,

    Very useful tutorial. I’have done everything up to the servlet completion. It seems the source code is in a file  Java Code: Attached in the file named “code.txt”  but I’m not able to find the attachment: can you kindly help?.

    Regards,

    Luigi.

    (0) 
  7. Itz Avila

    Hi all,

    I have de code.txt and it´s works 😀  :

     

    package com.pwc.demo.calculator;

    import java.io.IOException;
    import javax.servlet.ServletException;
    import javax.servlet.annotation.WebServlet;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;

    import com.sap.conn.jco.AbapException;
    import com.sap.conn.jco.JCoDestination;
    import com.sap.conn.jco.JCoDestinationManager;
    import com.sap.conn.jco.JCoException;
    import com.sap.conn.jco.JCoFunction;
    import com.sap.conn.jco.JCoParameterList;
    import com.sap.conn.jco.JCoRepository;
    import java.io.PrintWriter;

    /**
    * Servlet implementation class ConnectivityFRCDemo
    */
    @WebServlet(“/ConnectivityRFCDemo”)
    public class ConnectivityRFCDemo extends HttpServlet {
    private static final long serialVersionUID = 1L;

    /**
    * @see HttpServlet#HttpServlet()
    */
    public ConnectivityFRCDemo() {
    super();
    // TODO Auto-generated constructor stub
    }

    /**
    * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
    */
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    PrintWriter responseWriter = response.getWriter();
    try
    {
    // access the RFC Destination “JCoDemoSystem”
    JCoDestination destination=JCoDestinationManager.getDestination(“Connector”);
    int input1 = Integer.parseInt(request.getParameter(“input1”));
    int input2 = Integer.parseInt(request.getParameter(“input2”));
    JCoRepository repo=destination.getRepository();
    JCoFunction stfcConnection=repo.getFunction(“Function_Module”);

    JCoParameterList imports=stfcConnection.getImportParameterList();
    imports.setValue(“P_INPUT1”, input1);
    imports.setValue(“P_INPUT2”, input2);
    stfcConnection.execute(destination);
    JCoParameterList exports=stfcConnection.getExportParameterList();
    int resptext=exports.getInt(“P_RESULT”);
    request.getSession().setAttribute(“Result”, (“”+resptext));
    response.sendRedirect(“Result.jsp”);
    }
    catch (AbapException ae)
    {
    //just for completeness: As this function module does not have an exception
    //in its signature, this exception cannot occur. However,you should always
    //take care of AbapExceptions
    }
    catch (JCoException e)
    {
    response.addHeader(“Content-type”, “text/html”);
    responseWriter.println(“<html><body>”);
    responseWriter.println(“<h1>Exception occurred while executing STFC_CONNECTION in system JCoDemoSystem</h1>”);
    responseWriter.println(“<pre>”);
    e.printStackTrace(responseWriter);
    responseWriter.println(“</pre>”);
    responseWriter.println(“</body></html>”);
    }

    }

    /**
    * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
    */
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    // TODO Auto-generated method stub
    doGet(request, response);
    }

    }

     

     

     

    (0) 
    1. Thallita Cardeal

      Good afternoon people.
      I hope you’re well.

      I’m following the tutorial and when testing, the following error was reported:
      HTTP Status 500 – while trying to invoke the method com.sap.conn.jco.JCoFunction.getImportParameterList () of a null object loaded from local variable ‘stfcConnection’

      Can someone help me?

       

      (0) 
  8. Thallita Cardeal

    Good afternoon people.
    I hope you’re well.

    I’m following the tutorial and when testing, the following error was reported:
    HTTP Status 500 – while trying to invoke the method com.sap.conn.jco.JCoFunction.getImportParameterList () of a null object loaded from local variable ‘stfcConnection’

    Can someone help me?

    (0) 
  9. Danilo Mioto

    Good afternoon!

     

    One question: is there any minimum version for the SAP ERP to be so we can use the Cloud Connector?

    Appreciate the support.

     

    Best regards

    (0) 
  10. Mahesh Prasad Ray

    Hi Abhradeep,

    Could you please help me in how to establish the connectivity from Hana Cloud to On Premise BOBJ.

    I think we need to use cloud connector and rest part I am not sure.

     

    Thank you !!!

    (0) 

Leave a Reply