Communication Scenarios sind das zentrale Konzept für die Konfiguration von Schnittstellen in ABAP Cloud. Sie definieren, welche Dienste ein ABAP-System konsumieren (Outbound) oder bereitstellen (Inbound) kann, und ermöglichen eine saubere Trennung zwischen Entwicklung und Administration.
Das Communication Management Konzept
In ABAP Cloud ersetzt das Communication Management die klassischen Konfigurationsansätze wie SM59-Destinationen, SOAMANAGER oder SICF-Dienste. Es besteht aus vier Hauptkomponenten:
┌──────────────────────────────────────────────────────────────────────────┐│ Communication Management - Übersicht │├──────────────────────────────────────────────────────────────────────────┤│ ││ ┌─────────────────────────┐ ┌─────────────────────────┐ ││ │ Communication Scenario │ │ Communication System │ ││ │ (Entwickler) │ │ (Administrator) │ ││ │ │ │ │ ││ │ - Definiert Services │ │ - Repräsentiert │ ││ │ - Inbound/Outbound │ │ Zielsystem │ ││ │ - Authentifizierungs- │ │ - Host, Port, URL │ ││ │ methoden │ │ - Zertifikate │ ││ └────────────┬────────────┘ └────────────┬────────────┘ ││ │ │ ││ └───────────┬───────────────────┘ ││ │ ││ ▼ ││ ┌─────────────────────────┐ ││ │ Communication │ ││ │ Arrangement │ ││ │ (Administrator) │ ││ │ │ ││ │ - Verbindet Scenario │ ││ │ mit System │ ││ │ - Aktiviert Services │ ││ │ - Credentials │ ││ └────────────┬────────────┘ ││ │ ││ ▼ ││ ┌─────────────────────────┐ ││ │ Communication User │ ││ │ (Administrator) │ ││ │ │ ││ │ - Technischer Benutzer │ ││ │ - Authentifizierung │ ││ └─────────────────────────┘ ││ │└──────────────────────────────────────────────────────────────────────────┘Rollentrennung
| Rolle | Verantwortung | Artefakte |
|---|---|---|
| Entwickler | Definiert benötigte Schnittstellen | Communication Scenario |
| Administrator | Konfiguriert Verbindungen | System, User, Arrangement |
| Security | Verwaltet Credentials | Zertifikate, OAuth-Clients |
Communication Scenario
Das Communication Scenario ist das Herzstück des Communication Managements. Es wird vom Entwickler erstellt und definiert, welche Services das ABAP-System nutzen oder anbieten kann.
Scenario-Typen
Es gibt zwei grundlegende Typen von Communication Scenarios:
┌──────────────────────────────────────────────────────────────────────────┐│ Outbound Scenario Inbound Scenario ││ (ABAP ruft externes System) (Externes System ruft ABAP) ││ ││ ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌────────────┐││ │ ABAP Cloud │────>│ Externes │ │ Externes │────>│ ABAP Cloud │││ │ │ │ System │ │ System │ │ │││ └────────────┘ └────────────┘ └────────────┘ └────────────┘││ ││ Beispiele: Beispiele: ││ - REST API aufrufen - OData Service exponieren ││ - RFC zu S/4HANA - Webhook empfangen ││ - SOAP Service konsumieren - Event Handler ││ - Event Mesh publizieren - API für externe Apps │└──────────────────────────────────────────────────────────────────────────┘Standard-Scenarios von SAP
SAP liefert zahlreiche vorgefertigte Communication Scenarios aus:
| Scenario ID | Beschreibung | Typ |
|---|---|---|
| SAP_COM_0008 | OData Service Exposure | Inbound |
| SAP_COM_0276 | Destination Service Integration | Outbound |
| SAP_COM_0109 | SAP Event Mesh Integration | Outbound |
| SAP_COM_0193 | SOAP Service Consumption | Outbound |
| SAP_COM_0636 | SAP Forms Service by Adobe | Outbound |
Eigenes Communication Scenario erstellen
Für eigene Integrationen können Sie ein Custom Communication Scenario in ADT anlegen:
Schritt 1: Neues Scenario in ADT
Rechtsklick auf Package → New → Other ABAP Repository Object→ Cloud Communication Management → Communication ScenarioSchritt 2: Scenario konfigurieren
┌──────────────────────────────────────────────────────────────────────────┐│ Communication Scenario: Z_EXTERNAL_CRM │├──────────────────────────────────────────────────────────────────────────┤│ ID: Z_EXTERNAL_CRM ││ Description: Integration mit externem CRM-System ││ Scenario Type: Customer ││ ││ ┌── Outbound Services ────────────────────────────────────────────────┐ ││ │ Service ID Service Type Description │ ││ │ Z_CRM_REST HTTP REST API für Kundendaten │ ││ └─────────────────────────────────────────────────────────────────────┘ ││ ││ ┌── Supported Authentication Methods ─────────────────────────────────┐ ││ │ [x] Basic Authentication │ ││ │ [x] OAuth 2.0 Client Credentials │ ││ │ [ ] X.509 Certificate │ ││ └─────────────────────────────────────────────────────────────────────┘ │└──────────────────────────────────────────────────────────────────────────┘Schritt 3: Scenario als XML
Das Communication Scenario wird als XML-Datei im Repository gespeichert:
<?xml version="1.0" encoding="utf-8"?><communicationScenario id="Z_EXTERNAL_CRM" scenarioType="customer"> <description>Integration mit externem CRM-System</description>
<outboundServices> <service id="Z_CRM_REST"> <description>REST API für Kundendaten</description> <serviceType>http</serviceType> </service> </outboundServices>
<supportedAuthenticationMethods> <method>basic</method> <method>oauth2_client_credentials</method> </supportedAuthenticationMethods></communicationScenario>Communication System
Das Communication System repräsentiert das externe System, mit dem kommuniziert wird. Es enthält technische Verbindungsdetails wie Host, Port und Zertifikate.
System anlegen (Fiori App)
┌──────────────────────────────────────────────────────────────────────────┐│ Maintain Communication Systems │├──────────────────────────────────────────────────────────────────────────┤│ ││ System ID: EXTERNAL_CRM_PROD ││ System Name: Externes CRM Produktivsystem ││ ││ ┌── General ────────────────────────────────────────────────────────┐ ││ │ Host Name: api.crm-vendor.com │ ││ │ Port: 443 │ ││ │ HTTPS: [x] │ ││ └───────────────────────────────────────────────────────────────────┘ ││ ││ ┌── Technical Data ─────────────────────────────────────────────────┐ ││ │ [ ] Cloud Connector │ ││ │ [x] Internet │ ││ └───────────────────────────────────────────────────────────────────┘ ││ ││ ┌── OAuth 2.0 Settings ─────────────────────────────────────────────┐ ││ │ Token Endpoint: https://auth.crm-vendor.com/oauth/token │ ││ └───────────────────────────────────────────────────────────────────┘ ││ │└──────────────────────────────────────────────────────────────────────────┘System-Typen
| Proxy Type | Beschreibung | Verwendung |
|---|---|---|
| Internet | Direkter Internetzugang | Öffentliche APIs, Cloud-Services |
| OnPremise | Via SAP Cloud Connector | Interne Systeme hinter Firewall |
Zertifikate hinterlegen
Für Client Certificate Authentication oder Server-Zertifikatsvalidierung:
┌── SSL Client Certificate ────────────────────────────────────────────────┐│ Certificate: [Upload .p12 / .pem] ││ Private Key Password: ******** ││ ││ Subject: CN=abap-cloud-client, O=MyCompany ││ Issuer: CN=MyCompany CA ││ Valid until: 2027-01-15 │└──────────────────────────────────────────────────────────────────────────┘Communication User
Der Communication User ist ein technischer Benutzer für die Authentifizierung bei eingehenden Anfragen (Inbound-Szenarien).
User anlegen
┌──────────────────────────────────────────────────────────────────────────┐│ Maintain Communication Users │├──────────────────────────────────────────────────────────────────────────┤│ ││ User Name: CRM_INTEGRATION_USER ││ Description: Technischer User für CRM-Integration ││ ││ ┌── Authentication Method ──────────────────────────────────────────┐ ││ │ ( ) User ID and Password │ ││ │ (x) SSL Client Certificate │ ││ └───────────────────────────────────────────────────────────────────┘ ││ ││ ┌── For Password Authentication ────────────────────────────────────┐ ││ │ Password: ******** │ ││ │ Confirm Password: ******** │ ││ └───────────────────────────────────────────────────────────────────┘ ││ │└──────────────────────────────────────────────────────────────────────────┘User-Typen
| Methode | Sicherheit | Verwaltungsaufwand |
|---|---|---|
| User/Password | Mittel | Passwort-Rotation |
| Client Certificate | Hoch | Zertifikats-Erneuerung |
| OAuth 2.0 | Hoch | Token-Management automatisch |
Communication Arrangement
Das Communication Arrangement verbindet alle Komponenten und aktiviert die Kommunikation.
Arrangement anlegen
┌──────────────────────────────────────────────────────────────────────────┐│ Communication Arrangement │├──────────────────────────────────────────────────────────────────────────┤│ ││ Arrangement ID: Z_CRM_PROD_ARRANGEMENT ││ ││ ┌── Scenario ───────────────────────────────────────────────────────┐ ││ │ Communication Scenario: Z_EXTERNAL_CRM │ ││ └───────────────────────────────────────────────────────────────────┘ ││ ││ ┌── Communication System ───────────────────────────────────────────┐ ││ │ Communication System: EXTERNAL_CRM_PROD │ ││ └───────────────────────────────────────────────────────────────────┘ ││ ││ ┌── Outbound Services ──────────────────────────────────────────────┐ ││ │ Service Status Path │ ││ │ Z_CRM_REST Active /api/v2 │ ││ └───────────────────────────────────────────────────────────────────┘ ││ ││ ┌── Authentication ─────────────────────────────────────────────────┐ ││ │ Method: OAuth 2.0 Client Credentials │ ││ │ Client ID: crm-integration-client │ ││ │ Client Secret: ******** │ ││ └───────────────────────────────────────────────────────────────────┘ ││ │└──────────────────────────────────────────────────────────────────────────┘Inbound vs. Outbound im Detail
Outbound-Szenario: ABAP ruft externes System
Bei Outbound-Szenarien initiiert ABAP Cloud die Kommunikation zu einem externen System.
CLASS zcl_crm_client DEFINITION PUBLIC FINAL CREATE PUBLIC.
PUBLIC SECTION. INTERFACES if_oo_adt_classrun.
TYPES: BEGIN OF ty_customer, id TYPE string, name TYPE string, email TYPE string, END OF ty_customer.
METHODS get_customer IMPORTING iv_customer_id TYPE string RETURNING VALUE(rs_result) TYPE ty_customer RAISING cx_http_dest_provider_error cx_web_http_client_error.
PRIVATE SECTION. METHODS get_destination RETURNING VALUE(ro_destination) TYPE REF TO if_http_destination RAISING cx_http_dest_provider_error.ENDCLASS.
CLASS zcl_crm_client IMPLEMENTATION. METHOD if_oo_adt_classrun~main. TRY. DATA(ls_customer) = get_customer( '12345' ). out->write( |Kunde: { ls_customer-name } ({ ls_customer-email })| ).
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_destination. " Destination über Communication Arrangement abrufen ro_destination = cl_http_destination_provider=>create_by_comm_arrangement( comm_scenario = 'Z_EXTERNAL_CRM' service_id = 'Z_CRM_REST' ). ENDMETHOD.
METHOD get_customer. " 1. Destination abrufen DATA(lo_destination) = get_destination( ).
" 2. HTTP-Client erstellen DATA(lo_client) = cl_web_http_client_manager=>create_by_http_destination( i_destination = lo_destination ).
" 3. Request konfigurieren DATA(lo_request) = lo_client->get_http_request( ). lo_request->set_uri_path( |/customers/{ iv_customer_id }| ). 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( ). /ui2/cl_json=>deserialize( EXPORTING json = lv_json CHANGING data = rs_result ). ELSE. RAISE EXCEPTION TYPE cx_web_http_client_error. ENDIF.
lo_client->close( ). ENDMETHOD.ENDCLASS.Inbound-Szenario: Externes System ruft ABAP
Bei Inbound-Szenarien stellt ABAP Cloud Services bereit, die von externen Systemen aufgerufen werden.
OData Service exponieren:
- RAP Business Object erstellen
- Service Definition und Service Binding anlegen
- Inbound Communication Scenario erstellen oder SAP_COM_0008 nutzen
- Communication Arrangement für den Aufrufer einrichten
┌──────────────────────────────────────────────────────────────────────────┐│ Inbound Communication Scenario: Z_CUSTOMER_API │├──────────────────────────────────────────────────────────────────────────┤│ ││ ┌── Inbound Services ───────────────────────────────────────────────┐ ││ │ Service ID Service Type Service Binding │ ││ │ Z_CUSTOMER_ODATA OData V4 ZSB_CUSTOMER_V4 │ ││ └───────────────────────────────────────────────────────────────────┘ ││ ││ ┌── Supported Authentication ───────────────────────────────────────┐ ││ │ [x] User ID and Password │ ││ │ [x] OAuth 2.0 Client Credentials │ ││ │ [x] X.509 Certificate │ ││ └───────────────────────────────────────────────────────────────────┘ ││ │└──────────────────────────────────────────────────────────────────────────┘Authentifizierungsmethoden
Basic Authentication
Die einfachste Methode - Benutzername und Passwort werden im HTTP-Header übertragen:
" Bei Communication Arrangement mit Basic Auth:" - Im Arrangement werden Client ID und Secret hinterlegt" - Der HTTP-Client fügt den Authorization-Header automatisch hinzu
DATA(lo_destination) = cl_http_destination_provider=>create_by_comm_arrangement( comm_scenario = 'Z_EXTERNAL_CRM' service_id = 'Z_CRM_REST' ).
" Authentifizierung erfolgt automatisch basierend auf Arrangement-KonfigurationOAuth 2.0 Client Credentials
Für Machine-to-Machine-Kommunikation empfohlen:
┌──────────────────────────────────────────────────────────────────────────┐│ OAuth 2.0 Flow (Client Credentials) │├──────────────────────────────────────────────────────────────────────────┤│ ││ 1. ABAP Cloud ───────> OAuth Server ││ POST /oauth/token ││ grant_type=client_credentials ││ client_id=xxx ││ client_secret=yyy ││ ││ 2. OAuth Server ───────> ABAP Cloud ││ { "access_token": "eyJ...", "expires_in": 3600 } ││ ││ 3. ABAP Cloud ───────> Ziel-API ││ Authorization: Bearer eyJ... ││ ││ Das Token wird automatisch gecacht und vor Ablauf erneuert. │└──────────────────────────────────────────────────────────────────────────┘Im Communication System die OAuth-Einstellungen konfigurieren:
Token Service URL: https://auth.crm-vendor.com/oauth/tokenToken Service URL Type: Dedicated
Im Communication Arrangement:Client ID: crm-integration-clientClient Secret: ********X.509 Client Certificate
Höchste Sicherheitsstufe für kritische Integrationen:
┌──────────────────────────────────────────────────────────────────────────┐│ Certificate Authentication Flow │├──────────────────────────────────────────────────────────────────────────┤│ ││ 1. TLS-Handshake mit Client-Zertifikat ││ ABAP Cloud präsentiert sein Zertifikat ││ ││ 2. Server validiert Zertifikat ││ - Gültigkeit (Datum) ││ - Aussteller (CA) ││ - CN/Subject ││ ││ 3. Verschlüsselte Kommunikation ││ Alle Daten mit TLS verschlüsselt │└──────────────────────────────────────────────────────────────────────────┘Vollständiges Beispiel: Eigenes Communication Scenario
Anforderung
Ein Custom Communication Scenario für die Integration mit einem externen Lagerverwaltungssystem (WMS):
- REST-API-Aufruf für Bestandsabfrage
- SOAP-Service für Warenbewegungen
- OAuth 2.0 Authentifizierung
Schritt 1: Communication Scenario anlegen
In ADT: Rechtsklick auf Package → New → Other ABAP Repository Object → Communication Scenario
<?xml version="1.0" encoding="utf-8"?><communicationScenario id="Z_WMS_INTEGRATION" scenarioType="customer"> <description>Integration mit Warehouse Management System</description>
<outboundServices> <service id="Z_WMS_REST_STOCK"> <description>Bestandsabfrage REST</description> <serviceType>http</serviceType> </service> <service id="Z_WMS_SOAP_MOVEMENT"> <description>Warenbewegung SOAP</description> <serviceType>soap</serviceType> </service> </outboundServices>
<supportedAuthenticationMethods> <method>oauth2_client_credentials</method> </supportedAuthenticationMethods></communicationScenario>Schritt 2: Implementierung der API-Klasse
CLASS zcl_wms_api DEFINITION PUBLIC FINAL CREATE PUBLIC.
PUBLIC SECTION. TYPES: BEGIN OF ty_stock_item, material_id TYPE string, warehouse TYPE string, quantity TYPE decfloat16, unit TYPE string, END OF ty_stock_item, tt_stock_items TYPE STANDARD TABLE OF ty_stock_item WITH EMPTY KEY.
TYPES: BEGIN OF ty_movement, document_id TYPE string, material_id TYPE string, quantity TYPE decfloat16, movement_type TYPE string, END OF ty_movement.
" Bestandsabfrage über REST METHODS get_stock IMPORTING iv_material_id TYPE string RETURNING VALUE(rt_result) TYPE tt_stock_items RAISING cx_http_dest_provider_error cx_web_http_client_error.
" Warenbewegung über REST METHODS post_movement IMPORTING is_movement TYPE ty_movement RETURNING VALUE(rv_doc_id) TYPE string RAISING cx_http_dest_provider_error cx_web_http_client_error.
PRIVATE SECTION. CONSTANTS: c_scenario TYPE if_com_scenario_factory=>ty_cscn_id VALUE 'Z_WMS_INTEGRATION', c_service_stock TYPE if_com_scenario_factory=>ty_cscn_outb_srv_id VALUE 'Z_WMS_REST_STOCK', c_service_move TYPE if_com_scenario_factory=>ty_cscn_outb_srv_id VALUE 'Z_WMS_SOAP_MOVEMENT'.
METHODS get_http_destination IMPORTING iv_service_id TYPE if_com_scenario_factory=>ty_cscn_outb_srv_id RETURNING VALUE(ro_destination) TYPE REF TO if_http_destination RAISING cx_http_dest_provider_error.ENDCLASS.
CLASS zcl_wms_api IMPLEMENTATION. METHOD get_http_destination. " Destination aus Communication Arrangement abrufen ro_destination = cl_http_destination_provider=>create_by_comm_arrangement( comm_scenario = c_scenario service_id = iv_service_id ). ENDMETHOD.
METHOD get_stock. " 1. Destination für Stock-Service abrufen DATA(lo_destination) = get_http_destination( c_service_stock ).
" 2. HTTP-Client erstellen DATA(lo_client) = cl_web_http_client_manager=>create_by_http_destination( i_destination = lo_destination ).
TRY. " 3. Request konfigurieren DATA(lo_request) = lo_client->get_http_request( ). lo_request->set_uri_path( |/stock?material={ iv_material_id }| ). 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( ). /ui2/cl_json=>deserialize( EXPORTING json = lv_json CHANGING data = rt_result ). ENDIF.
CLEANUP. lo_client->close( ). ENDTRY. ENDMETHOD.
METHOD post_movement. DATA(lo_destination) = get_http_destination( c_service_stock ).
DATA(lo_client) = cl_web_http_client_manager=>create_by_http_destination( i_destination = lo_destination ).
TRY. DATA(lo_request) = lo_client->get_http_request( ). lo_request->set_uri_path( '/movements' ).
" JSON-Body erstellen DATA(lv_json) = /ui2/cl_json=>serialize( data = is_movement compress = abap_true pretty_name = /ui2/cl_json=>pretty_mode-camel_case ).
lo_request->set_text( lv_json ). lo_request->set_header_field( i_name = 'Content-Type' i_value = 'application/json' ).
" POST ausführen DATA(lo_response) = lo_client->execute( if_web_http_client=>post ).
IF lo_response->get_status( )-code = 201. " Document-ID aus Response extrahieren DATA: BEGIN OF ls_response, document_id TYPE string, END OF ls_response.
/ui2/cl_json=>deserialize( EXPORTING json = lo_response->get_text( ) CHANGING data = ls_response ).
rv_doc_id = ls_response-document_id. ENDIF.
CLEANUP. lo_client->close( ). ENDTRY. ENDMETHOD.ENDCLASS.Schritt 3: Administrator-Konfiguration
Nach dem Transport des Communication Scenarios kann der Administrator die Verbindung einrichten:
-
Communication System anlegen:
- System ID: WMS_PROD
- Host: api.wms-vendor.com
- Port: 443
- OAuth Token URL: https://auth.wms-vendor.com/oauth/token
-
Communication Arrangement anlegen:
- Scenario: Z_WMS_INTEGRATION
- System: WMS_PROD
- OAuth Client ID und Secret hinterlegen
- Services aktivieren
Troubleshooting
Häufige Fehler und Lösungen
1. “No Communication Arrangement found”
Fehler: CX_HTTP_DEST_PROVIDER_ERROR No Communication Arrangement found for scenario Z_EXTERNAL_CRMUrsachen und Lösungen:
| Ursache | Lösung |
|---|---|
| Arrangement nicht angelegt | Fiori App “Maintain Communication Arrangements” öffnen |
| Scenario-ID falsch | Exact match prüfen (case-sensitive) |
| Service nicht aktiviert | Im Arrangement den Service aktivieren |
| Arrangement nicht aktiv | Status auf “Active” setzen |
2. “Authentication failed”
Fehler: HTTP 401 UnauthorizedCheckliste:
- Credentials im Arrangement korrekt hinterlegt?
- Bei OAuth: Token-URL erreichbar?
- Client ID und Secret korrekt?
- Bei Certificate: Zertifikat noch gültig?
- Bei Basic Auth: Passwort nicht abgelaufen?
3. “Connection refused / Timeout”
Fehler: CX_WEB_HTTP_CLIENT_ERROR Connection refusedPrüfpunkte:
┌── Connectivity Checklist ────────────────────────────────────────────────┐│ ││ 1. Host erreichbar? ││ - DNS-Auflösung funktioniert? ││ - Port offen (443 für HTTPS)? ││ ││ 2. Cloud Connector (bei OnPremise)? ││ - Cloud Connector läuft? ││ - Virtual Host korrekt konfiguriert? ││ - Resource Path freigegeben? ││ ││ 3. SSL/TLS? ││ - Server-Zertifikat gültig? ││ - CA im Trust Store? ││ ││ 4. Firewall? ││ - Ausgehende Verbindung erlaubt? ││ - IP-Whitelist auf Zielseite? │└──────────────────────────────────────────────────────────────────────────┘4. “Service ID not found”
Fehler: Service 'Z_MY_SERVICE' not found in scenario 'Z_MY_SCENARIO'Lösung:
- Communication Scenario in ADT öffnen
- Outbound Services prüfen
- Service-ID exakt übernehmen
- Scenario aktivieren und transportieren
Debugging-Tipps
1. Destination testen:
TRY. DATA(lo_dest) = cl_http_destination_provider=>create_by_comm_arrangement( comm_scenario = 'Z_EXTERNAL_CRM' service_id = 'Z_CRM_REST' ).
" Destination-Details ausgeben DATA(lv_url) = lo_dest->get_uri( ). out->write( |URL: { lv_url }| ).
CATCH cx_http_dest_provider_error INTO DATA(lx_error). out->write( |Fehler: { lx_error->get_text( ) }| ).ENDTRY.2. HTTP-Response analysieren:
DATA(lo_response) = lo_client->execute( if_web_http_client=>get ).
" Status und ReasonDATA(ls_status) = lo_response->get_status( ).out->write( |Status: { ls_status-code } { ls_status-reason }| ).
" Response-HeaderDATA(lt_headers) = lo_response->get_header_fields( ).LOOP AT lt_headers INTO DATA(ls_header). out->write( |{ ls_header-name }: { ls_header-value }| ).ENDLOOP.
" Response-Body (bei Fehlern oft hilfreich)DATA(lv_body) = lo_response->get_text( ).out->write( lv_body ).3. Application Logging nutzen:
" Logging für Troubleshooting einbauenDATA(lo_log) = cl_bali_log=>create_with_header( header = cl_bali_header_setter=>create( )->set_object( 'ZCOMM_MGMT' ) ->set_subobject( 'DEBUG' ) ).
lo_log->add_item( cl_bali_message_setter=>create( severity = if_bali_constants=>c_severity_status id = 'ZCOMM_MSG' number = '001' )->set_text( |Calling { lv_url }| ) ).
cl_bali_log_db=>get_instance( )->save_log( lo_log ).Best Practices
| Thema | Empfehlung |
|---|---|
| Namenskonvention | Z_{SYSTEM}_{FUNKTION} für Scenarios |
| Authentifizierung | OAuth 2.0 für neue Integrationen, Certificate für hochkritische |
| Umgebungen | Separate Arrangements für DEV/QA/PROD |
| Credentials | Nie im Code, immer im Arrangement |
| Fehlerbehandlung | Spezifische Exceptions für Destination vs. HTTP-Fehler |
| Monitoring | Application Logging für alle API-Aufrufe |
| Dokumentation | Scenario-Beschreibung und Abhängigkeiten dokumentieren |
Weiterführende Themen
- SAP Destination Service - BTP Destinations nutzen
- HTTP Client in ABAP - REST-APIs aufrufen
- OAuth 2.0 / JWT in ABAP Cloud - Token-basierte Authentifizierung
- RFC in ABAP Cloud - RFC-Kommunikation konfigurieren