Skip to Content
Feb 01, 2022 at 04:21 PM

Documentation: Deploy SaaS Solutions (MTX) - Dependencies to Destination / Connectivity Service

1407 Views Last edit Feb 01, 2022 at 05:54 PM 2 rev

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");
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