on ‎2022 May 04 10:50 AM
Hi all,
My requirement is a simple api call to Business Partner A2X (https://api.sap.com/api/OP_API_BUSINESS_PARTNER_SRV/cloud-sdk/Java). My on-premise S4 HANA system is connected to BTP via cloud connector. I could execute an api call to the Business Partner via a destination created of type on-premise (with sap-client property) and the url is the one maintained in cloud connector. Everything works fine.

What I have done so far:
#1: Now, I would like to access this destination from my local machine without changing and pushing code to BTP. So, I have followed this blog (https://sap.github.io/cloud-sdk/docs/java/features/connectivity/sdk-connectivity-destination-service) and have maintained my environment variable "destinations" as below
set destinations =[{"type":"HTTP","name":"SAPABAPBACKEND","url":"http://SAPABAPBACKEND.dest","proxyType":"on-premise","proxyHost":"localhost","proxyPort":8080,"user":"user","password":"password", "properties": [{"key": "TrustAll", "value": "true"}, {"key": "sap-client", "value": "102"}, {"key": "sap-language", "value": "en"}] }]
When I set this variable, I always get 404. I am not sure if the values above are correct. What exactly is the URL here? Also, if I can use my reverse proxy url of my on-premise system, should it be of type internet? If internet then where should I set the sap-client property?
#2: Removing the destinations variable and copied the environment variables VCAP_SERVICES that was system generated in BTP into the root folder of my application in a default-env.json file but it gives me the error "Failed to get 'destination' service credentials from VCAP_SERVICES variable: no service binding found for service plan '(any)'". I could ssh into my application though.
What has worked so far:
I have tried to use sap-cf-proxy https://github.com/jowavp/sap-cf-proxy and it detects the onpremise destination but only works if I append the sap-client parameter to it like below:
Somehow the sap-client parameter is not considered.
gregorw alexander.duemont What am I missing here? Any help would be greatly appreciated. Thanks so much
Request clarification before answering.
Hi gamergtx260
Unfortunately, you cannot reach On-Premise systems from your local development machine.
This is because the Cloud Connector denies any connections that are not originating from the same subnet as the Cloud Connector is a part of (this is a security feature to prevent attackers from gaining access to your OP systems).
That said, you have the possibility to use the Business Application Studio (BAS) to develop your application.
Within your BAS instance, you can configure your `destinations` environment variable in a way that actually allows you to also reach your On-Premise system.
This works because your BAS instance is backed by a container in your BTP Workspace, which can be connected to via a local proxy that is running on the BAS machine. In consequence, the Cloud Connector accepts the proxied request since it is indeed coming from within the same subnet.
You can learn more about the exact details and how to configure your BAS environment in our documentation.
Best regards,
Johannes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi johannes.schneider,
would be great to get your feedback on the option that I've provided with sap-cf-proxy.
CU
Gregor
Hey gregorw
I took a brief look into the sap-cf-proxy project and it seems to do exactly what one would need to reach OP systems even from local dev machines - awesome!
Unfortunately, we (the SAP Cloud SDK team) were not aware of that tool.
I'll reach out to our PO to get some capacity for testing the setup and to extend our documentation.
In general, I think the approach would work very similarly to what we have already described with the BAS scenario (i.e. users would need to configure their local `destinations` environment variable to use the local proxy to reach the OP system).
Thanks for bringing our attention to this project!
Best regards,
Johannes
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 7 | |
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.