Hello CAP Team, Hi Iwona Hahn,
in the last days I've spent quite some time to get remote services, defined in destinations of the Subscriber Subaccount working. The most crutial part was to return the xsappname as described in Register the Multitenant Application to the SAP SaaS Provisioning Service from the Variable: <VCAP_SERVICES.<service>.credentials.xsappname.
The Cookbook - Deploy SaaS Solutions does mention the SAP BTP Dependencies but uses this example
"mtx": { "dependencies": ["xsappname-1", "xsappname-2"] }
to be put into the package.json. But as the xsappname is dynamic I would suggest to replace this with the code I've added to the server.js:
const xsenv = require("@sap/xsenv"); xsenv.loadEnv(); const services = xsenv.getServices({ dest: { tag: "destination" }, conn: { tag: "connectivity" }, }); cds.env.mtx.dependencies = [services.dest.xsappname, services.conn.xsappname];
In addition the section Use Destinations from Subscriber Account should mention that for On Premise destination also the connectivity service must be bound. Especially as an S/4HANA System is given as an example.
Best Regards
Gregor