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.
Please give sap-cf-proxy. My team is using it since over a year to connect from our local development systems to the on prem destination.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gregor,
Yes, I have tried to use sap-cf-proxy, it detects the onpremise destination but only works if I append the sap-client parameter to it like below: I tested this with postman only.
http://localhost:5050/sap/opu/odata/sap/API_BUSINESS_PARTNER/A_BusinessPartner?sap-client=102&$select=BusinessPartner
Somehow the parameter "sap-client" is not taken into account. I have set this both in environment variable and also in destinations.
Please have a look at my code and error below:
Env variable:
[{"type":"HTTP","name":"SAP_ABAP_BACKEND","url":"http://localhost:5050","proxyType":"on-premise","proxyHost":"localhost","proxyPort":5050,"user":"user","password":"password", "sap-client":"102", "properties": [{"key": "TrustAll", "value": "true"}, {"key": "sap-client", "value": "102"}, {"key": "sap-language", "value": "en"}] }]
Code snippet:

the error I get in sap-cf-proxy is below

Thanks
Please create an issue in the sap-cf-proxy project and if you want to get a quick solution try to contribute the fix via a pull request.
| 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.