ERPClimb logoERPClimb
Destinations
BTP & Integrationbeginner 5 min read

BTP Destinations Part 1: What the Destination Service Does

Free sample lesson · open to everyone

Key takeaway

The destination service stores how to reach remote systems — URL, authentication and proxy details — so apps, integration flows and SAP Build tools can connect without hard-coded settings. Learn destination levels (subaccount vs service instance), types (HTTP, RFC, MAIL, LDAP), and how consumers read them.

In this lessonShow sections

Visual overview

DESTINATIONSHow an app resolves a destinationName in code, details in BTP1App requests destination by namee.g. S4H_ODATAApp?Instance-level destination?Checked first for the service instanceNo → subaccount-level destinationYes2Destination detailsURL, auth, proxy typeDestination3Token/credentials preparedPer authentication typeAuthCall to target systemInternet or via Cloud ConnectorTargetTip: avoid the same name at both levels — the instance-level one wins.

The situation: a real project scenario

A team had the same destination name at subaccount and instance level pointing to different S/4 systems; test calls hit production. Renaming and removing duplicates fixed it.

Explanation

This series looks at the Destination service across three parts: what it does, proxy types and authentication together with Cloud Connector, and choosing the right authentication method — this lesson covers the first of those. Destinations exist to centralize connection data, meaning the target URL, authentication details and proxy settings, outside of the application code that consumes them.

They can live at two levels: at the subaccount level, where they're shared across everything in that subaccount, or at the destination service instance level, where they're specific to one application. The most common destination type is HTTP, but RFC, MAIL and LDAP destinations also exist for their respective protocols.

A wide range of consumers rely on destinations, including the app router, the SAP Cloud SDK and CAP, SAP Build, HTML5 applications and various integration tools.

One subtlety worth knowing well is the lookup order: a destination defined at the instance level with the same name as one at the subaccount level will override the subaccount-level one, and not knowing this order can lead to calls silently going to the wrong system.

The general guidance is to keep shared back-end destinations at the subaccount level and app-specific ones at the instance level, and to avoid duplicate names across levels, since that kind of duplication produces "wrong system" calls that are genuinely hard to spot.

In practice this means creating a subaccount-level HTTP destination, consuming it from an app router route, and checking the connection — the goal being that the app can reach its target purely by destination name, with no connection details hard-coded anywhere.

Expert visual walkthrough

BTP ACADEMY · PART 1 · Integration pathERPClimb.com

Destination resolution

Destinations · Chapter-specific technical teaching map

Integration path

1Concept

Application

2Concept

Destination lookup

3Concept

Credentials / proxy

4Concept

Target service

Tutor's chapter takeaway

The destination service stores how to reach remote systems — URL, authentication and proxy details — so apps, integration flows and SAP Build tools can connect without hard-coded settings. Learn destination levels (subaccount vs service instance), types (HTTP, RFC…

In a real project

A team had the same destination name at subaccount and instance level pointing to different S/4 systems; test calls hit production. Renaming and removing duplicates fixed it.

Watch out for

• Hard-coding target URLs in application code defeats the purpose of the destination service and makes environment moves painful — always read connection details from a destination. • Using the same destination name at both…

Conceptual study map, not an SAP configuration screenshot or a guaranteed runtime sequence. Consult the lesson for implementation prerequisites and exceptions.

Code example

ABAP Code
===== xs-app.json route (app router) =====This route forwards any call under /s4/* to the destination named S4H_ODATA, after the app router checks the user is logged in via XSUAA:{ "source": "^/s4/(.*)$", "target": "$1", "destination": "S4H_ODATA", "authenticationType": "xsuaa" } ===== CAP (package.json excerpt) =====This tells the CAP service to fetch Business Partner OData through the destination instead of a hardcoded URL, so credentials and routing stay outside the code:"cds": { "requires": { "API_BUSINESS_PARTNER": { "kind": "odata-v2", "credentials": { "destination": "S4H_ODATA" } } } }

Watch out

Common mistakes

  • Hard-coding target URLs in application code defeats the purpose of the destination service and makes environment moves painful — always read connection details from a destination.
  • Using the same destination name at both subaccount and service-instance level causes unpredictable "wrong system" calls, since the instance-level one silently overrides the subaccount one — keep names unique across levels.
  • Storing secrets directly in code or configuration instead of in the destination's authentication settings or certificate store exposes credentials — use destination-managed secrets.
  • Picking the wrong level (subaccount vs. instance) for a destination makes it either too widely shared or inaccessible to the app that needs it — choose the level deliberately based on scope.
  • Skipping the "Check Connection" step after creating a destination lets a misconfiguration surface only when the application fails in production — always test the connection first.

Do this

Best practices

  • Centralize all connection data in destinations rather than application code.
  • Give every destination a unique, unambiguous name regardless of level.
  • Store credentials and certificates in the destination service's own secure stores, never inline.
  • Decide deliberately whether a destination belongs at subaccount or service-instance level based on who needs to share it.
  • Run "Check Connection" immediately after creating or changing a destination.

In the interview

Interview angle

Questions: "What is the destination service?", "Subaccount vs instance level?", "How do apps consume destinations?"
Strong answer: purpose, levels, types, consumers, operations.

Practice this lesson

Quick check

0 of 3 questions attempted

Question 1 of 3

A destination with the same name is defined both at the subaccount level and at the level of a specific application/service instance in the BTP cockpit. When an application looks up this destination by name at runtime, which configuration takes precedence?

Practise this in an interview

Answer in your own words and get instant feedback, the way an interviewer would judge it.

1What are the core concepts of Destinations, and how would you explain them clearly in an SAP interview?

2Test calls from a BTP app hit a production S/4HANA system. Explain how destinations are resolved and how you'd fix this.

See it in code

Each example starts from a requirement, shows the design, then the code step by step with a plain-language explanation of every part.

Was this lesson helpful?

Keep exploring

Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.