Skip to Content
1

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

Dec 15, 2017 at 12:36 PM

280

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Ivan Mirisola
Dec 21, 2017 at 07:46 PM
1

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

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Thanks, Ivan

I have partially resolved this issue. It was the location ID in the cloud connector configuration which had created the issue. When I removed it from there, HANA XS is able to connect to the backend using the same destination. Now the location ID is the bottleneck. I have tried the below piece of code as well to correctly point to the location. However it did not work. Do you have any clue?

request.headers.set("SAP-Connectivity-SCC-Location_ID", "XXXX");

Also, I am interested to know about the point 1 (Configure Cloud Connector to sync the tables you need on SCP and consume them locally on SCP ). Are you referring to SDI using ODATA adaptors? Where Can I find more details?

Thanks you so much for your support.

Ajith Cheruvally

0

Hi Ajith,

SDI is the "automated" option. SLT would be another option to run side-by-side with your S4/HANA.

Another option requires more manual setup. SCC enables you to open a connection to your HANA DB so applications running on the LAN can access your HANA DB via ODBC/JDBC just like any other DB.

If SLT is an option to you, it would be possible to create the connection between SLT and HANA using SCC as a proxy to your HANA DB on the Cloud. Otherwise, you could manually deploy triggers on the required tables to monitor for changes on them and send those to the cloud via ODBC/JDBC - of course, you would need to do an initial load first by the using the same ODBC/JDBC connectivity.

Regards,
Ivan

0

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

0