Skip to Content

Unable to connect to on-premise system from productive SCP HANA XS using cloud connector

Hello Experts,

I am trying to connect to an S4HANA on premise system from SCP HANA XS. I have configured the Cloud Connector, created the tunnel to my sub account, exposed the resources. I am able to create a destination in Cloud Platform and subsequently use it in WebIDE to create web applications.

However, I am getting the below error when I connect to the same on-premise system using XSJS.

"Access denied to system virtualpingbackend:1234. In case this was a valid request, ensure to expose the system correctly in your SAP HANA Cloud connector."

XSHTTP Destination fille

host = "virtualpingbackend";
port = 1234;
pathPrefix = "/sap/opu/odata/sap/";
proxyType = http;
proxyHost = "localhost";
proxyPort = 20003;
authType = basic;
useSSL = false;
timeout = 3000;

XSJS File

    var destinationPackage = "<PackageName>";
                var destinationName = "DEST_T46";
                var request;
                var dest = $.net.http.readDestination(destinationPackage, destinationName);

                var client = new $.net.http.Client();
                request = new $.web.WebRequest($.net.http.GET, "/<Service>/<entitySet>"); 
                request.headers.set("Content-Type", "application/json");
                request.headers.set("charset", "utf-8");
                client.request(request, dest);
                var response = client.getResponse();
                
                return {
                "body": JSON.stringify(response.body.asString())
            };

Please find attached the cloud connector settings screenshot.

Also, I could not find any access related messages in the log or audit files.

Have I missed anything? Please help!!!

cloud-to-onpremise.jpg

cloud-connector-to-subaccount.jpg

Thanks,

Ajith Cheruvally

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Dec 21, 2017 at 07:46 PM

    Hi Ajith,

    I believe that you are missing the "useProxy = true" on your xshttpdest file:

    host = "virtualpingbackend";
    port = 1234;
    useSSL = false;
    pathPrefix = "/BackendAppHttpBasicAuth/basic";
    useProxy = true;
    proxyHost = "localhost";
    proxyPort = 20003;
    timeout = 3000;

    By defining the proxy as localhost:2003 HANA will reach your service through Hana Cloud Connector.

    However, there are other more "efficient" ways of consuming the data on your S4/HANA local instance via Cloud Connector:

    1. Configure Cloud Connector to sync the tables you need on SCP and consume them locally on SCP
    2. Create an OData service on S4/HANA and consume the service directly on your SAPUI5 application using the same destinations concept.

    Regards,
    Ivan

    Add comment
    10|10000 characters needed characters exceeded

    • According the this comment on an SCC blog, you could add the http header like you mentioned.

      The location ID is needed when you have several SCCs connected to the same Sub-Account in SCP. So if you really need this feature and the http request header has no effect for you, than you could try adding the following to your destination:

      CloudConnectorLocationId=<Location ID used on your SCC account settings>
      CloudConnectorVersion=2<br>

      However I am not entirely sure the same parameters from Cokpit's Connectivity Service applies to HANA's xshttpdest. But it is worth a try. It is kind of a new feature from SCC, but I would expect it to be implemented already in HANA. If not, please open an Incident on SAP's Support System to check which parameter should be used instead.

      If you don't actually intend on using such feature, you could remove the Location ID on your cloud connector as it is not a mandatory setting.

      Regards,
      Ivan