SAP Cloud Connector: On-Premise Systeme aus ABAP Cloud anbinden

kategorie
Integration
Veröffentlicht
autor
Johannes

Der SAP Cloud Connector (SCC) ist die zentrale Komponente für die sichere Kommunikation zwischen SAP BTP und On-Premise-Systemen. Er ermöglicht ABAP Cloud-Anwendungen den Zugriff auf Backend-Systeme im Firmennetzwerk, ohne diese direkt im Internet exponieren zu müssen.

Warum Cloud Connector?

In hybriden Landschaften mit SAP S/4HANA Cloud und On-Premise-Systemen entsteht regelmäßig der Bedarf, Daten auszutauschen:

SzenarioBeispiel
Stammdaten abrufenMaterialstamm aus SAP ECC lesen
Transaktionsdaten synchronisierenBestellungen an On-Premise SAP weiterleiten
Legacy-Systeme integrierenDaten aus alten Non-SAP-Systemen abrufen
RFC-AufrufeFunktionsbausteine im On-Premise-System ausführen
OData-Services konsumierenOn-Premise Gateway Services nutzen

Der Cloud Connector löst dabei mehrere Herausforderungen:

AspektOhne Cloud ConnectorMit Cloud Connector
NetzwerkOn-Premise öffentlich erreichbarOn-Premise bleibt geschützt
FirewallEingehende Ports öffnenNur ausgehende Verbindung
SicherheitDirekter Internet-ZugriffTunnel mit Verschlüsselung
KonfigurationURL/IP im CodeVirtual Hosts abstrahieren
ZertifikateManuelles ManagementZentrale Verwaltung

Architektur

Der Cloud Connector arbeitet als Reverse-Proxy und baut eine ausgehende, verschlüsselte Verbindung zur SAP BTP auf:

┌─────────────────────────────────────────────────────────────────────────┐
│ SAP BTP (Cloud) │
│ ┌──────────────┐ ┌─────────────────┐ ┌────────────────────────┐ │
│ │ ABAP Cloud │───>│ Connectivity │───>│ Cloud Connector │ │
│ │ Application │ │ Service │ │ Service (Destination) │ │
│ └──────────────┘ └─────────────────┘ └───────────┬────────────┘ │
│ │ │
└─────────────────────────────────────────────────────────│───────────────┘
TLS-verschlüsselter Tunnel
(ausgehende Verbindung)
┌─────────────────────────────────────────────────────────│───────────────┐
│ Firmennetzwerk (On-Premise) │ │
│ ┌─────────────────┐ ┌──────────────────────────────┴─────────────┐ │
│ │ SAP ECC │<───│ SAP Cloud Connector │ │
│ │ S/4HANA │ │ │ │
│ │ Gateway │ │ - Mapping: Virtual Host → Internal Host │ │
│ │ Andere Systeme │ │ - Access Control Lists │ │
│ └─────────────────┘ │ - Audit Logging │ │
│ └────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────┘

Kernkomponenten

KomponenteFunktion
Cloud ConnectorOn-Premise-Software, baut Tunnel zur BTP auf
Connectivity ServiceBTP-Service, verwaltet Tunnel-Verbindungen
Destination ServiceBTP-Service, speichert Verbindungskonfigurationen
Virtual HostAlias für On-Premise-Systeme (z.B. sapecc.internal:443)

Installation und Grundkonfiguration

1. Cloud Connector installieren

Der Cloud Connector wird auf einem Server im Firmennetzwerk installiert:

┌──────────────────────────────────────────────────────────────┐
│ Cloud Connector Installation │
├──────────────────────────────────────────────────────────────┤
│ Plattformen: │
│ ├── Windows Server (MSI-Installer) │
│ ├── Linux (RPM/DEB-Pakete) │
│ └── Docker (Container-Image) │
│ │
│ Systemanforderungen: │
│ ├── Java Runtime 8 oder höher │
│ ├── 2 GB RAM (empfohlen: 4 GB) │
│ ├── Ausgehender HTTPS-Zugriff auf BTP │
│ └── Zugriff auf On-Premise-Systeme │
│ │
│ Standard-Ports: │
│ ├── 8443: Administration UI │
│ └── 8444: HA-Cluster (optional) │
└──────────────────────────────────────────────────────────────┘

2. Subaccount verbinden

Nach der Installation wird der Cloud Connector mit dem BTP-Subaccount verknüpft:

┌──────────────────────────────────────────────────────────────┐
│ Cloud Connector Administration │
│ https://scc-server:8443 │
├──────────────────────────────────────────────────────────────┤
│ Define Subaccount Connection │
│ │
│ Region: cf-eu10 (Europe - Frankfurt) │
│ Subaccount: my-subaccount-id │
│ Display Name: Production Cloud Connector │
│ Subaccount User: [email protected]
│ Password: ******** │
│ │
│ Location ID: PROD_LOCATION (optional, für Multi-SCC) │
│ │
│ [Connect] │
└──────────────────────────────────────────────────────────────┘

3. Virtual Host und Resource Mapping

Virtual Hosts abstrahieren die internen Systemadressen:

┌──────────────────────────────────────────────────────────────┐
│ Cloud to On-Premise Mapping │
├──────────────────────────────────────────────────────────────┤
│ Backend Type: SAP ABAP System │
│ Protocol: HTTPS │
│ │
│ ┌─ Virtual Host (Cloud-seitig) ───────────────────────────┐ │
│ │ Virtual Host: sapecc │ │
│ │ Virtual Port: 443 │ │
│ └──────────────────────────────────────────────────────────┘ │
│ │
│ ┌─ Internal Host (On-Premise) ────────────────────────────┐ │
│ │ Internal Host: sapecc.corp.local │ │
│ │ Internal Port: 44300 │ │
│ └──────────────────────────────────────────────────────────┘ │
│ │
│ Principal Propagation: [x] Enabled │
│ Host in Request Header: Internal Host │
└──────────────────────────────────────────────────────────────┘

4. Resources (URL-Pfade) freigeben

Nicht alle Pfade werden automatisch freigegeben. Sie müssen explizit Resources definieren:

┌──────────────────────────────────────────────────────────────┐
│ Resources for sapecc:443 │
├──────────────────────────────────────────────────────────────┤
│ ┌─ Resource 1 ────────────────────────────────────────────┐ │
│ │ URL Path: /sap/opu/odata/ │ │
│ │ Access Policy: Path and all sub-paths │ │
│ │ Description: OData Services │ │
│ └──────────────────────────────────────────────────────────┘ │
│ │
│ ┌─ Resource 2 ────────────────────────────────────────────┐ │
│ │ URL Path: /sap/bc/srt/ │ │
│ │ Access Policy: Path and all sub-paths │ │
│ │ Description: SOAP Web Services │ │
│ └──────────────────────────────────────────────────────────┘ │
│ │
│ ┌─ Resource 3 ────────────────────────────────────────────┐ │
│ │ URL Path: /sap/bc/adt/ │ │
│ │ Access Policy: Path and all sub-paths │ │
│ │ Description: ADT Services (optional) │ │
│ └──────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────┘

Destination im BTP Cockpit

Nach der Cloud Connector-Konfiguration muss eine Destination im BTP Cockpit erstellt werden:

┌──────────────────────────────────────────────────────────────┐
│ Destination Configuration │
├──────────────────────────────────────────────────────────────┤
│ Name: SAP_ECC_ODATA │
│ Type: HTTP │
│ URL: http://sapecc:443 │
│ Proxy Type: OnPremise │
│ Authentication: PrincipalPropagation │
│ │
│ ┌─ Additional Properties ─────────────────────────────────┐ │
│ │ sap-client: 100 │ │
│ │ HTML5.DynamicDestination: true │ │
│ │ WebIDEEnabled: true │ │
│ │ WebIDEUsage: odata_abap │ │
│ └──────────────────────────────────────────────────────────┘ │
│ │
│ Location ID: PROD_LOCATION (falls konfiguriert) │
└──────────────────────────────────────────────────────────────┘

Authentifizierungsoptionen

TypBeschreibungUse Case
PrincipalPropagationUser-Kontext wird weitergegebenSSO, Berechtigungsprüfung im Backend
BasicAuthenticationTechnischer BenutzerSystem-zu-System ohne User-Kontext
NoAuthenticationKeine AuthentifizierungÖffentliche Services (selten)

On-Premise OData Service aufrufen

Communication Arrangement einrichten

Für die Nutzung in ABAP Cloud wird ein Communication Arrangement benötigt:

┌──────────────────────────────────────────────────────────────┐
│ Communication Arrangement │
├──────────────────────────────────────────────────────────────┤
│ Scenario: SAP_COM_0276 (Destination Service) │
│ │
│ Communication System: BTP_CONNECTIVITY │
│ ├── Host: destination-configuration.cfapps.eu10.hana... │
│ ├── Port: 443 │
│ └── Auth: OAuth 2.0 │
│ │
│ Outbound Services: │
│ └── Destination Service API: Active │
└──────────────────────────────────────────────────────────────┘

ABAP-Code: OData Service aufrufen

CLASS zcl_onprem_odata_client DEFINITION
PUBLIC FINAL
CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES if_oo_adt_classrun.
TYPES:
BEGIN OF ty_material,
matnr TYPE string,
maktx TYPE string,
meins TYPE string,
mtart TYPE string,
END OF ty_material,
tt_materials TYPE STANDARD TABLE OF ty_material WITH EMPTY KEY.
METHODS get_materials
IMPORTING iv_plant TYPE string OPTIONAL
RETURNING VALUE(rt_result) TYPE tt_materials
RAISING cx_http_dest_provider_error
cx_web_http_client_error.
PRIVATE SECTION.
CONSTANTS c_destination TYPE string VALUE 'SAP_ECC_ODATA'.
ENDCLASS.
CLASS zcl_onprem_odata_client IMPLEMENTATION.
METHOD if_oo_adt_classrun~main.
TRY.
DATA(lt_materials) = get_materials( iv_plant = '1000' ).
out->write( |Gefundene Materialien: { lines( lt_materials ) }| ).
LOOP AT lt_materials INTO DATA(ls_material).
out->write( |{ ls_material-matnr } - { ls_material-maktx }| ).
ENDLOOP.
CATCH cx_http_dest_provider_error INTO DATA(lx_dest).
out->write( |Destination-Fehler: { lx_dest->get_text( ) }| ).
CATCH cx_web_http_client_error INTO DATA(lx_http).
out->write( |HTTP-Fehler: { lx_http->get_text( ) }| ).
ENDTRY.
ENDMETHOD.
METHOD get_materials.
" 1. Destination vom Cloud Connector abrufen
DATA(lo_destination) = cl_http_destination_provider=>create_by_cloud_destination(
i_name = c_destination
i_authn_mode = if_a4c_cp_service=>user_propagation ).
" 2. HTTP Client erstellen
DATA(lo_client) = cl_web_http_client_manager=>create_by_http_destination(
i_destination = lo_destination ).
" 3. OData-Request konfigurieren
DATA(lo_request) = lo_client->get_http_request( ).
" OData Service Pfad (z.B. Material-Service im ECC)
DATA(lv_path) = '/sap/opu/odata/sap/API_MATERIAL_STOCK_SRV/A_MaterialStock'.
" Filter hinzufügen
IF iv_plant IS NOT INITIAL.
lv_path = lv_path && |?$filter=Plant eq '{ iv_plant }'|.
ENDIF.
lo_request->set_uri_path( lv_path ).
lo_request->set_header_field(
i_name = 'Accept'
i_value = 'application/json' ).
" 4. Request ausführen
DATA(lo_response) = lo_client->execute( if_web_http_client=>get ).
DATA(lv_status) = lo_response->get_status( )-code.
IF lv_status = 200.
DATA(lv_json) = lo_response->get_text( ).
" 5. JSON parsen (OData Wrapper beachten)
DATA: BEGIN OF ls_odata_response,
d TYPE ty_odata_results,
END OF ls_odata_response,
BEGIN OF ty_odata_results,
results TYPE tt_materials,
END OF ty_odata_results.
/ui2/cl_json=>deserialize(
EXPORTING json = lv_json
CHANGING data = ls_odata_response ).
rt_result = ls_odata_response-d-results.
ELSE.
DATA(lv_error) = lo_response->get_text( ).
lo_client->close( ).
RAISE EXCEPTION TYPE cx_web_http_client_error.
ENDIF.
lo_client->close( ).
ENDMETHOD.
ENDCLASS.

OData mit Service Consumption Model

Für typsichere Aufrufe kann ein Service Consumption Model generiert werden:

" 1. Service Consumption Model in ADT erstellen:
" - Other ABAP Repository Objects → Connectivity → Service Consumption Model
" - OData Service URL: http://sapecc:443/sap/opu/odata/sap/API_MATERIAL_STOCK_SRV/$metadata
" - Generiert: Proxy-Klasse und Datentypen
" 2. Verwendung des generierten Proxys
CLASS zcl_material_service DEFINITION
PUBLIC FINAL
CREATE PUBLIC.
PUBLIC SECTION.
METHODS get_materials
RETURNING VALUE(rt_result) TYPE zt_material
RAISING /iwbep/cx_cp_remote.
ENDCLASS.
CLASS zcl_material_service IMPLEMENTATION.
METHOD get_materials.
" Proxy nutzt automatisch die konfigurierte Destination
DATA(lo_client) = NEW zsc_material_stock_srv( ).
" Typsicherer Aufruf mit generierten Strukturen
DATA(lt_filter) = VALUE /iwbep/if_cp_filter_node=>ty_t_filter(
( property = 'Plant' value = '1000' ) ).
rt_result = lo_client->get_a_material_stock(
it_filter = lt_filter ).
ENDMETHOD.
ENDCLASS.

RFC über Cloud Connector

Neben HTTP-basierten Services kann der Cloud Connector auch RFC-Verbindungen tunneln:

┌──────────────────────────────────────────────────────────────┐
│ Cloud to On-Premise (RFC) │
├──────────────────────────────────────────────────────────────┤
│ Backend Type: SAP ABAP System │
│ Protocol: RFC │
│ │
│ Virtual Host: sapecc-rfc │
│ Virtual Port: <generated> │
│ │
│ Internal Host: sapecc.corp.local │
│ Instance Number: 00 │
│ System ID: ECC │
│ │
│ Principal Propagation: [x] Enabled │
└──────────────────────────────────────────────────────────────┘
" RFC-Aufruf über Cloud Connector
METHOD call_onprem_bapi.
DATA: lt_return TYPE STANDARD TABLE OF bapiret2.
" RFC-Destination vom Destination Service
DATA(lv_destination) = cl_rfc_destination_provider=>create_by_cloud_destination(
i_name = 'SAP_ECC_RFC' ).
CALL FUNCTION 'BAPI_MATERIAL_GET_ALL'
DESTINATION lv_destination
EXPORTING
plant = '1000'
TABLES
return = lt_return
EXCEPTIONS
communication_failure = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
" Fehlerbehandlung
ENDIF.
ENDMETHOD.

Sicherheitsaspekte

Access Control Lists

Der Cloud Connector bietet feingranulare Zugriffskontrolle:

┌──────────────────────────────────────────────────────────────┐
│ Access Control │
├──────────────────────────────────────────────────────────────┤
│ System: sapecc:443 │
│ │
│ Resources: │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ Path │ Policy │ Description │ │
│ ├─────────────────────────────────────────────────────────┤ │
│ │ /sap/opu/odata/sap/ │ Subpaths │ OData APIs │ │
│ │ /sap/bc/srt/rfc/ │ Subpaths │ RFC via HTTP │ │
│ │ /sap/bc/adt/ │ Exact + Sub │ ADT (Dev) │ │
│ │ / │ BLOCKED │ Root blocked │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │
│ Hinweis: Immer nur benötigte Pfade freigeben! │
└──────────────────────────────────────────────────────────────┘

Principal Propagation einrichten

Principal Propagation ermöglicht Single Sign-On zwischen Cloud und On-Premise:

┌──────────────────────────────────────────────────────────────┐
│ Principal Propagation Setup │
├──────────────────────────────────────────────────────────────┤
│ 1. X.509-Zertifikat im Cloud Connector generieren │
│ Cloud Connector Admin → Configuration → On Premise → │
│ Principal Propagation → CN: <subaccount> │
│ │
│ 2. Zertifikat im On-Premise-System importieren │
│ Transaktion STRUST → SSL Server Standard → Import │
│ │
│ 3. Rule-Based User Mapping konfigurieren (CERTRULE) │
│ - Cloud-User-Attribut auf On-Premise-User mappen │
│ - z.B. email → SAP-Benutzer │
│ │
│ 4. ICF-Service konfigurieren (SICF) │
│ - SSL aktivieren │
│ - Client Certificate Login erlauben │
└──────────────────────────────────────────────────────────────┘

Audit Logging

Alle Zugriffe werden protokolliert:

┌──────────────────────────────────────────────────────────────┐
│ Cloud Connector Audit Log │
├──────────────────────────────────────────────────────────────┤
│ Timestamp │ User │ System │ Path │
│ ─────────────────────┼────────────┼───────────┼─────────────│
│ 2026-02-14 10:23:45 │ user@comp │ sapecc │ /sap/opu/.. │
│ 2026-02-14 10:23:12 │ tech_user │ sapecc │ /sap/bc/.. │
│ 2026-02-14 10:22:58 │ user@comp │ sapecc │ /sap/opu/.. │
└──────────────────────────────────────────────────────────────┘

High Availability

Für produktive Szenarien wird ein hochverfügbares Setup empfohlen:

┌────────────────────────────────────────────────────────────────────────┐
│ High Availability Setup │
│ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Master │ │ Shadow │ │
│ │ Cloud Conn. │<──>│ Cloud Conn. │ │
│ │ (Active) │HA │ (Standby) │ │
│ └──────┬───────┘ └──────┬───────┘ │
│ │ │ │
│ └─────────┬─────────┘ │
│ │ │
│ ┌─────────┴─────────┐ │
│ │ On-Premise │ │
│ │ Backend │ │
│ └───────────────────┘ │
│ │
│ - Master und Shadow synchronisieren Konfiguration │
│ - Bei Master-Ausfall übernimmt Shadow automatisch │
│ - Gleiche Subaccount-Verbindung │
└────────────────────────────────────────────────────────────────────────┘

Fehlerbehandlung und Troubleshooting

Häufige Fehler

FehlerUrsacheLösung
404 Not FoundResource nicht im SCC freigegebenURL-Pfad in Resources hinzufügen
502 Bad GatewayOn-Premise-System nicht erreichbarNetzwerkverbindung prüfen
403 ForbiddenFehlende BerechtigungAccess Control / Principal Propagation prüfen
Connection refusedCloud Connector offlineSCC-Status prüfen, Neustart
SSL Handshake ErrorZertifikatsproblemZertifikate in STRUST prüfen

Diagnose-Code

CLASS zcl_scc_diagnostics DEFINITION
PUBLIC FINAL
CREATE PUBLIC.
PUBLIC SECTION.
CLASS-METHODS check_connectivity
IMPORTING iv_destination TYPE string
RETURNING VALUE(rv_status) TYPE string.
ENDCLASS.
CLASS zcl_scc_diagnostics IMPLEMENTATION.
METHOD check_connectivity.
TRY.
" Destination abrufen
DATA(lo_destination) = cl_http_destination_provider=>create_by_cloud_destination(
i_name = iv_destination
i_authn_mode = if_a4c_cp_service=>service_specific ).
" Einfachen Request senden
DATA(lo_client) = cl_web_http_client_manager=>create_by_http_destination(
i_destination = lo_destination ).
DATA(lo_request) = lo_client->get_http_request( ).
lo_request->set_uri_path( '/' ).
DATA(lo_response) = lo_client->execute( if_web_http_client=>get ).
DATA(lv_status) = lo_response->get_status( )-code.
lo_client->close( ).
rv_status = |HTTP { lv_status } - Verbindung erfolgreich|.
CATCH cx_http_dest_provider_error INTO DATA(lx_dest).
rv_status = |Destination-Fehler: { lx_dest->get_text( ) }|.
CATCH cx_web_http_client_error INTO DATA(lx_http).
rv_status = |HTTP-Fehler: { lx_http->get_text( ) }|.
ENDTRY.
ENDMETHOD.
ENDCLASS.

Cloud Connector Logs

Im Cloud Connector Admin UI unter MonitorConnections:

┌──────────────────────────────────────────────────────────────┐
│ Connection Log │
├──────────────────────────────────────────────────────────────┤
│ 2026-02-14 10:30:15 INFO - Tunnel established │
│ 2026-02-14 10:30:14 INFO - Connecting to Connectivity Svc │
│ 2026-02-14 10:30:12 INFO - Starting Cloud Connector │
│ │
│ Trace Level: INFO | DEBUG | WARNING | ERROR │
└──────────────────────────────────────────────────────────────┘

Best Practices

ThemaEmpfehlung
Minimale RechtevergabeNur benötigte URL-Pfade in Resources freigeben
Separate UmgebungenEigene Cloud Connectors für DEV/QA/PROD
Location ID nutzenBei mehreren SCCs im selben Subaccount
HA-SetupImmer Master + Shadow für produktive Systeme
MonitoringSAP Cloud ALM für Connectivity Monitoring
ZertifikateRechtzeitig vor Ablauf erneuern (Alarme einrichten)
Audit LogsRegelmäßig prüfen, SIEM-Integration erwägen
UpdatesCloud Connector regelmäßig aktualisieren
Principal PropagationBevorzugt für Berechtigungsprüfung im Backend
TimeoutsAngemessene Werte in Destinations konfigurieren

Zusammenfassung

Der SAP Cloud Connector ist unverzichtbar für hybride Szenarien:

  • Sichere Verbindung: Verschlüsselter Tunnel, keine eingehenden Ports
  • Feingranulare Kontrolle: Access Control Lists, Audit Logging
  • Flexible Authentifizierung: Principal Propagation, Basic Auth
  • Hochverfügbar: Master/Shadow-Setup für produktive Systeme
  • Protokollvielfalt: HTTP, RFC, LDAP, Mail

Weiterführende Themen