SAP Integration Suite mit ABAP Cloud: Enterprise Integration

kategorie
Integration
Veröffentlicht
autor
Johannes

SAP Integration Suite ist die zentrale Integrationsplattform auf der SAP Business Technology Platform. Sie ermöglicht die Verbindung von ABAP Cloud mit Cloud-Diensten, On-Premise-Systemen und Drittanbieter-Anwendungen über standardisierte Schnittstellen und Protokolle.

SAP Integration Suite Überblick

Die SAP Integration Suite bietet verschiedene Capabilities für unterschiedliche Integrationsszenarien:

CapabilityBeschreibungABAP Cloud Relevanz
Cloud IntegrationiPaaS für Nachrichten-basierte IntegrationiFlows aus ABAP aufrufen
API ManagementAPI-Gateway und Lifecycle ManagementABAP-APIs veröffentlichen
Event MeshEvent-basierte IntegrationRAP Business Events
Open ConnectorsVorkonfigurierte AdapterVereinfachte Anbindung
Integration AdvisorB2B/EDI-NachrichtenverarbeitungGeschäftspartner-Integration

Architektur: ABAP Cloud und Integration Suite

┌─────────────────────────────────────────────────────────────────────────┐
│ SAP Business Technology Platform │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────────┐ ┌──────────────────────────────────────┐ │
│ │ ABAP Cloud │ │ SAP Integration Suite │ │
│ │ │ │ │ │
│ │ ┌────────────┐ │ HTTP │ ┌─────────────────────────────────┐ │ │
│ │ │ RAP BO │──┼──────┼─>│ Cloud Integration (iFlows) │ │ │
│ │ │ (Actions) │ │ │ │ │ │ │
│ │ └────────────┘ │ │ │ ┌─────┐ ┌─────┐ ┌─────┐ │ │ │
│ │ │ │ │ │Start│───>│ Map │───>│ End │ │ │ │
│ │ ┌────────────┐ │Events│ │ └─────┘ └─────┘ └─────┘ │ │ │
│ │ │ Business │──┼──────┼─>│ │ │ │
│ │ │ Events │ │ │ └─────────────────────────────────┘ │ │
│ │ └────────────┘ │ │ │ │
│ │ │ │ ┌─────────────────────────────────┐ │ │
│ │ ┌────────────┐ │ OData│ │ API Management │ │ │
│ │ │ OData │<─┼──────┼──│ (Gateway, Policies, Analytics) │ │ │
│ │ │ Services │ │ │ └─────────────────────────────────┘ │ │
│ │ └────────────┘ │ │ │ │
│ └──────────────────┘ └──────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────┐
│ Externe Systeme │
│ - SAP S/4HANA │
│ - Salesforce │
│ - SAP SuccessFactors │
│ - Third-Party APIs │
└──────────────────────────────┘

Szenario 1: ABAP als Quelle (Outbound)

In diesem Szenario ruft ABAP Cloud einen iFlow in der Integration Suite auf, um Daten zu transformieren oder an externe Systeme zu senden.

Communication Scenario für Integration Suite

┌──────────────────────────────────────────────────────────────┐
│ Communication Scenario: Z_INT_SUITE_OUTBOUND │
├──────────────────────────────────────────────────────────────┤
│ Communication Type: Outbound │
│ │
│ Outbound Services: │
│ └── Z_INT_SUITE_IFLOW │
│ ├── Service Type: HTTP │
│ ├── Path: /cxf/http/* │
│ └── Authentication: OAuth 2.0 Client Credentials │
│ │
│ Supported Authentication Methods: │
│ ├── [x] OAuth 2.0 Client Credentials │
│ └── [x] Client Certificate │
└──────────────────────────────────────────────────────────────┘

Communication System für Cloud Integration

┌──────────────────────────────────────────────────────────────┐
│ Communication System: CPI_TENANT │
├──────────────────────────────────────────────────────────────┤
│ General Data: │
│ ├── System ID: CPI │
│ ├── System Name: SAP Cloud Integration Tenant │
│ └── System Type: SAP Cloud Integration │
│ │
│ Technical Data: │
│ ├── Host: my-tenant.it-cpi001-rt.cfapps.eu10.hana.ondemand.com│
│ ├── Port: 443 │
│ └── Path Prefix: /cxf/http │
│ │
│ OAuth 2.0 Settings: │
│ ├── Token Endpoint: https://my-tenant.authentication.eu10.../token│
│ ├── Client ID: sb-integration-suite-client!t12345 │
│ └── Client Secret: ******** │
└──────────────────────────────────────────────────────────────┘

iFlow aufrufen aus ABAP Cloud

CLASS zcl_integration_suite_client DEFINITION
PUBLIC FINAL
CREATE PUBLIC.
PUBLIC SECTION.
TYPES: BEGIN OF ty_order_message,
order_id TYPE c LENGTH 10,
customer_id TYPE c LENGTH 10,
total_amount TYPE decfloat34,
currency TYPE waers,
items TYPE STANDARD TABLE OF ty_order_item WITH EMPTY KEY,
END OF ty_order_message,
BEGIN OF ty_order_item,
product_id TYPE c LENGTH 18,
quantity TYPE i,
price TYPE decfloat34,
END OF ty_order_item,
BEGIN OF ty_iflow_response,
status TYPE c LENGTH 20,
message_id TYPE sysuuid_c32,
external_id TYPE string,
END OF ty_iflow_response.
METHODS send_order_to_iflow
IMPORTING
is_order TYPE ty_order_message
RETURNING
VALUE(rs_response) TYPE ty_iflow_response
RAISING
cx_http_dest_provider_error
cx_web_http_client_error.
ENDCLASS.
CLASS zcl_integration_suite_client IMPLEMENTATION.
METHOD send_order_to_iflow.
" Destination aus Communication Arrangement holen
DATA(lo_destination) = cl_http_destination_provider=>create_by_comm_arrangement(
comm_scenario = 'Z_INT_SUITE_OUTBOUND'
service_id = 'Z_INT_SUITE_IFLOW' ).
" HTTP Client erstellen
DATA(lo_client) = cl_web_http_client_manager=>create_by_http_destination(
i_destination = lo_destination ).
DATA(lo_request) = lo_client->get_http_request( ).
" iFlow-Endpunkt setzen (relativ zum Path Prefix)
lo_request->set_uri_path( '/orderProcessing' ).
" Header setzen
lo_request->set_header_field(
i_name = 'Content-Type'
i_value = 'application/json' ).
" Optionale Custom Header für iFlow-Routing
lo_request->set_header_field(
i_name = 'SAP_ApplicationID'
i_value = 'ABAP_CLOUD_ORDERS' ).
lo_request->set_header_field(
i_name = 'SAP_Sender'
i_value = 'ABAP_ENVIRONMENT' ).
" Order als JSON serialisieren
DATA(lv_json) = /ui2/cl_json=>serialize(
data = is_order
compress = abap_true
pretty_name = /ui2/cl_json=>pretty_mode-camel_case ).
lo_request->set_text( lv_json ).
" POST an iFlow senden
DATA(lo_response) = lo_client->execute( if_web_http_client=>post ).
DATA(lv_status) = lo_response->get_status( )-code.
DATA(lv_body) = lo_response->get_text( ).
lo_client->close( ).
" Response auswerten
IF lv_status >= 200 AND lv_status < 300.
" Erfolg - Response parsen
/ui2/cl_json=>deserialize(
EXPORTING json = lv_body
CHANGING data = rs_response ).
ELSE.
" Fehler
RAISE EXCEPTION TYPE cx_web_http_client_error
EXPORTING
status_code = lv_status.
ENDIF.
ENDMETHOD.
ENDCLASS.

RAP Action für iFlow-Aufruf

" Behavior Definition
define behavior for ZI_SALESORDER alias SalesOrder
{
action sendToIntegrationSuite result [1] $self;
}
" Behavior Implementation
CLASS lhc_salesorder DEFINITION INHERITING FROM cl_abap_behavior_handler.
PRIVATE SECTION.
METHODS send_to_integration_suite FOR MODIFY
IMPORTING keys FOR ACTION SalesOrder~sendToIntegrationSuite RESULT result.
ENDCLASS.
CLASS lhc_salesorder IMPLEMENTATION.
METHOD send_to_integration_suite.
" Bestelldaten lesen
READ ENTITIES OF zi_salesorder IN LOCAL MODE
ENTITY SalesOrder
ALL FIELDS WITH CORRESPONDING #( keys )
RESULT DATA(lt_orders)
FAILED failed.
" Items lesen
READ ENTITIES OF zi_salesorder IN LOCAL MODE
ENTITY SalesOrder BY \_Items
ALL FIELDS WITH CORRESPONDING #( keys )
RESULT DATA(lt_items).
DATA(lo_client) = NEW zcl_integration_suite_client( ).
LOOP AT lt_orders INTO DATA(ls_order).
" Message aufbauen
DATA(ls_message) = VALUE zcl_integration_suite_client=>ty_order_message(
order_id = ls_order-OrderId
customer_id = ls_order-CustomerId
total_amount = ls_order-TotalAmount
currency = ls_order-Currency
items = VALUE #( FOR item IN lt_items
WHERE ( orderid = ls_order-orderid )
( product_id = item-ProductId
quantity = item-Quantity
price = item-Price ) ) ).
TRY.
" An Integration Suite senden
DATA(ls_response) = lo_client->send_order_to_iflow( ls_message ).
" Externe ID speichern
MODIFY ENTITIES OF zi_salesorder IN LOCAL MODE
ENTITY SalesOrder
UPDATE FIELDS ( ExternalId IntegrationStatus )
WITH VALUE #( (
%tky = ls_order-%tky
ExternalId = ls_response-external_id
IntegrationStatus = 'SENT' ) ).
APPEND VALUE #(
%tky = ls_order-%tky
%param = CORRESPONDING #( ls_order )
) TO result.
CATCH cx_http_dest_provider_error
cx_web_http_client_error INTO DATA(lx_error).
" Fehler melden
APPEND VALUE #(
%tky = ls_order-%tky
%msg = new_message_with_text( text = lx_error->get_text( ) )
) TO reported-salesorder.
MODIFY ENTITIES OF zi_salesorder IN LOCAL MODE
ENTITY SalesOrder
UPDATE FIELDS ( IntegrationStatus )
WITH VALUE #( (
%tky = ls_order-%tky
IntegrationStatus = 'ERROR' ) ).
ENDTRY.
ENDLOOP.
ENDMETHOD.
ENDCLASS.

Szenario 2: ABAP als Ziel (Inbound)

In diesem Szenario ruft die Integration Suite einen OData-Service oder eine HTTP-API in ABAP Cloud auf.

OData Service für Integration Suite exponieren

@EndUserText.label: 'Produkt für Integration'
@AccessControl.authorizationCheck: #NOT_REQUIRED
define root view entity ZI_PRODUCT_INT
as select from zproduct
{
key product_id as ProductId,
product_name as ProductName,
category as Category,
price as Price,
currency as Currency,
stock as Stock,
@Semantics.systemDateTime.lastChangedAt: true
last_changed as LastChanged
}

Service Definition und Binding

@EndUserText.label: 'Product Integration Service'
define service Z_PRODUCT_INTEGRATION {
expose ZI_PRODUCT_INT as Products;
}

Communication Scenario für Inbound

┌──────────────────────────────────────────────────────────────┐
│ Communication Scenario: Z_PRODUCT_INBOUND │
├──────────────────────────────────────────────────────────────┤
│ Communication Type: Inbound │
│ │
│ Inbound Services: │
│ └── Z_PRODUCT_INTEGRATION (OData V4) │
│ ├── Service URL: /sap/opu/odata4/sap/z_product_int/... │
│ └── Methods: GET, POST, PUT, PATCH, DELETE │
│ │
│ Supported Authentication Methods: │
│ ├── [x] OAuth 2.0 (SAML Bearer Assertion) │
│ ├── [x] Client Certificate │
│ └── [x] Basic Authentication │
└──────────────────────────────────────────────────────────────┘

iFlow-Konfiguration für ABAP-Aufruf

In der Cloud Integration wird ein HTTP Adapter konfiguriert:

┌──────────────────────────────────────────────────────────────┐
│ iFlow: Product Sync to ABAP Cloud │
├──────────────────────────────────────────────────────────────┤
│ │
│ ┌───────┐ ┌──────────┐ ┌─────────────┐ ┌───────┐ │
│ │ Start │───>│ Mapping │───>│ HTTP │───>│ End │ │
│ │ (SF) │ │ (XSLT) │ │ Receiver │ │ │ │
│ └───────┘ └──────────┘ └─────────────┘ └───────┘ │
│ │ │
│ ▼ │
│ HTTP Receiver Adapter: │
│ ├── Address: https://my-abap.abap.eu10.hana.ondemand.com │
│ ├── Proxy Type: Internet │
│ ├── Method: POST │
│ ├── Path: /sap/opu/odata4/sap/z_product_int/Products │
│ └── Authentication: OAuth2 Client Credentials │
│ ├── Token Endpoint: https://my-abap.authentication... │
│ ├── Client ID: integration-user │
│ └── Client Secret: (Secure Parameter) │
└──────────────────────────────────────────────────────────────┘

Batch-Verarbeitung mit Deep Insert

Für Massen-Updates kann die Integration Suite Batch-Requests an ABAP senden:

" iFlow sendet OData $batch Request
" ABAP Cloud verarbeitet automatisch:
POST /sap/opu/odata4/sap/z_product_int/$batch
Content-Type: multipart/mixed; boundary=batch_123
--batch_123
Content-Type: application/http
POST Products HTTP/1.1
Content-Type: application/json
{"ProductId":"P001","ProductName":"Widget","Price":99.99,"Currency":"EUR"}
--batch_123
Content-Type: application/http
POST Products HTTP/1.1
Content-Type: application/json
{"ProductId":"P002","ProductName":"Gadget","Price":149.99,"Currency":"EUR"}
--batch_123--

Szenario 3: Event-basierte Integration

Die Integration Suite Event Mesh verbindet RAP Business Events mit externen Systemen.

RAP Business Events definieren

managed implementation in class zbp_i_order unique;
strict ( 2 );
define behavior for ZI_ORDER alias Order
persistent table zorder
lock master
authorization master ( instance )
with additional save
{
create;
update;
delete;
" Business Events für Integration
event orderCreated parameter ZA_ORDER_CREATED_EVENT;
event orderCompleted parameter ZA_ORDER_COMPLETED_EVENT;
event orderCancelled parameter ZA_ORDER_CANCELLED_EVENT;
determination triggerOrderCreated on save { create; }
determination triggerOrderCompleted on save { field Status; }
}

Event-Parameter

@EndUserText.label: 'Order Created Event'
define abstract entity ZA_ORDER_CREATED_EVENT
{
OrderId : abap.char(10);
CustomerId : abap.char(10);
TotalAmount : abap.dec(15,2);
Currency : abap.cuky;
CreatedAt : timestampl;
CreatedBy : abap.uname;
}
@EndUserText.label: 'Order Completed Event'
define abstract entity ZA_ORDER_COMPLETED_EVENT
{
OrderId : abap.char(10);
CompletedAt : timestampl;
DeliveryDate : abap.dats;
TrackingNumber: abap.char(30);
}

Event Publishing

CLASS lhc_order IMPLEMENTATION.
METHOD trigger_order_created.
READ ENTITIES OF zi_order IN LOCAL MODE
ENTITY Order
ALL FIELDS WITH CORRESPONDING #( keys )
RESULT DATA(lt_orders).
RAISE ENTITY EVENT zi_order~orderCreated
FROM VALUE #( FOR order IN lt_orders
( %key = order-%key
%param = VALUE #(
orderid = order-OrderId
customerid = order-CustomerId
totalamount = order-TotalAmount
currency = order-Currency
createdat = utclong_current( )
createdby = sy-uname ) ) ).
ENDMETHOD.
METHOD trigger_order_completed.
READ ENTITIES OF zi_order IN LOCAL MODE
ENTITY Order
ALL FIELDS WITH CORRESPONDING #( keys )
RESULT DATA(lt_orders).
" Nur für abgeschlossene Bestellungen
DATA(lt_completed) = VALUE #( FOR order IN lt_orders
WHERE ( status = 'COMPLETED' ) ( order ) ).
IF lt_completed IS NOT INITIAL.
RAISE ENTITY EVENT zi_order~orderCompleted
FROM VALUE #( FOR order IN lt_completed
( %key = order-%key
%param = VALUE #(
orderid = order-OrderId
completedat = utclong_current( )
deliverydate = order-DeliveryDate
trackingnumber = order-TrackingNumber ) ) ).
ENDIF.
ENDMETHOD.
ENDCLASS.

Event Mesh Konfiguration

┌──────────────────────────────────────────────────────────────┐
│ Enterprise Event Enablement │
├──────────────────────────────────────────────────────────────┤
│ Channel: Z_ORDER_EVENTS │
│ ├── Topic Space: default/sap.abapcloud/order │
│ └── Destination: EVENT_MESH_DESTINATION │
│ │
│ Topic Bindings: │
│ ├── ZI_ORDER.ORDERCREATED │
│ │ └── Topic: sap/abapcloud/order/created/v1 │
│ ├── ZI_ORDER.ORDERCOMPLETED │
│ │ └── Topic: sap/abapcloud/order/completed/v1 │
│ └── ZI_ORDER.ORDERCANCELLED │
│ └── Topic: sap/abapcloud/order/cancelled/v1 │
└──────────────────────────────────────────────────────────────┘

iFlow als Event Consumer

┌──────────────────────────────────────────────────────────────┐
│ iFlow: Order Event Processing │
├──────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌──────────┐ ┌─────────────┐ │
│ │ AMQP │───>│ Router │───>│ HTTP │ │
│ │ Sender │ │ (Topic) │ │ Receiver │ │
│ └─────────────┘ └──────────┘ └─────────────┘ │
│ │ │ │ │
│ ▼ │ ▼ │
│ Event Mesh Queue │ External System │
│ queue:order-events │ (CRM, ERP, etc.) │
│ │ │
│ ├── sap/.../created ──> CRM │
│ ├── sap/.../completed ──> Billing │
│ └── sap/.../cancelled ──> Refund │
└──────────────────────────────────────────────────────────────┘

API Management für ABAP Services

ABAP OData Service im API Management registrieren

┌──────────────────────────────────────────────────────────────┐
│ API Management: Z_PRODUCT_API │
├──────────────────────────────────────────────────────────────┤
│ API Provider: │
│ ├── Name: ABAP Cloud Product Service │
│ ├── Type: SAP ABAP Environment │
│ ├── Host: my-abap.abap.eu10.hana.ondemand.com │
│ └── Service: Z_PRODUCT_INTEGRATION │
│ │
│ API Proxy: │
│ ├── Base Path: /products/v1 │
│ ├── Target Path: /sap/opu/odata4/sap/z_product_int │
│ └── Virtual Host: api.mycompany.com │
│ │
│ Policies: │
│ ├── Quota: 1000 calls/hour per API Key │
│ ├── Spike Arrest: 10 calls/second │
│ ├── OAuth2 Validation: Required │
│ └── Response Caching: 5 minutes (GET only) │
└──────────────────────────────────────────────────────────────┘

API-Aufruf über API Management

Externe Konsumenten rufen die ABAP-API über das API Gateway auf:

Terminal window
# API-Aufruf mit OAuth2 Token
curl -X GET "https://api.mycompany.com/products/v1/Products" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H "APIKey: ${API_KEY}"

Komplettes Integrationsbeispiel

Szenario: Order-to-Cash Integration

┌─────────────────────────────────────────────────────────────────────────┐
│ Order-to-Cash Integration Flow │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ 1. Bestellung in ABAP Cloud erstellt │
│ │ │
│ ▼ │
│ 2. Business Event "orderCreated" ausgelöst │
│ │ │
│ ▼ │
│ 3. Event Mesh propagiert an Integration Suite │
│ │ │
│ ├──────────────────────────┬──────────────────────────┐ │
│ ▼ ▼ ▼ │
│ 4a. CRM Update 4b. Fulfillment 4c. Analytics │
│ (Salesforce) (SAP EWM) (SAC) │
│ │ │ │ │
│ ▼ ▼ │ │
│ 5a. Opportunity 5b. Lieferschein │ │
│ aktualisiert erstellt │ │
│ │ │ │
│ ▼ │ │
│ 6. Versand erfolgt │ │
│ │ │ │
│ ▼ │ │
│ 7. Event "shipped" │ │
│ │ │ │
│ ▼ │ │
│ 8. ABAP Cloud │ │
│ Status Update │ │
│ │ │ │
│ ▼ │ │
│ 9. Event "completed"───────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────┘

iFlow für Multi-Target Routing

" ABAP Cloud sendet Order-Event
" Integration Suite routet an multiple Targets
CLASS zcl_order_integration DEFINITION
PUBLIC FINAL
CREATE PUBLIC.
PUBLIC SECTION.
METHODS process_order_created
IMPORTING
is_event TYPE za_order_created_event.
ENDCLASS.
CLASS zcl_order_integration IMPLEMENTATION.
METHOD process_order_created.
" Direkter Aufruf eines iFlows für komplexe Orchestrierung
DATA(lo_destination) = cl_http_destination_provider=>create_by_comm_arrangement(
comm_scenario = 'Z_INT_SUITE_ORCHESTRATION' ).
DATA(lo_client) = cl_web_http_client_manager=>create_by_http_destination(
i_destination = lo_destination ).
DATA(lo_request) = lo_client->get_http_request( ).
" iFlow für Order-Orchestrierung
lo_request->set_uri_path( '/orderOrchestration' ).
lo_request->set_header_field(
i_name = 'Content-Type'
i_value = 'application/json' ).
" Event-Daten mit Routing-Info
DATA(ls_message) = VALUE ty_orchestration_message(
event_type = 'ORDER_CREATED'
event_data = is_event
routing = VALUE #(
( target = 'CRM' enabled = abap_true )
( target = 'FULFILLMENT' enabled = abap_true )
( target = 'ANALYTICS' enabled = abap_true ) ) ).
DATA(lv_json) = /ui2/cl_json=>serialize( data = ls_message ).
lo_request->set_text( lv_json ).
" Asynchroner Aufruf (Fire-and-Forget für Event-Propagierung)
TRY.
lo_client->execute( if_web_http_client=>post ).
CATCH cx_web_http_client_error.
" Fehler loggen für spätere Wiederholung
ENDTRY.
lo_client->close( ).
ENDMETHOD.
ENDCLASS.

Fehlerbehandlung und Monitoring

Retry-Logik für iFlow-Aufrufe

CLASS zcl_integration_retry DEFINITION
PUBLIC FINAL
CREATE PUBLIC.
PUBLIC SECTION.
CONSTANTS: c_max_retries TYPE i VALUE 3,
c_retry_delay TYPE i VALUE 2000.
METHODS call_iflow_with_retry
IMPORTING
iv_path TYPE string
iv_payload TYPE string
RETURNING
VALUE(rv_response) TYPE string
RAISING
cx_web_http_client_error.
ENDCLASS.
CLASS zcl_integration_retry IMPLEMENTATION.
METHOD call_iflow_with_retry.
DATA: lv_retries TYPE i VALUE 0,
lv_delay TYPE i.
lv_delay = c_retry_delay.
WHILE lv_retries < c_max_retries.
TRY.
DATA(lo_destination) = cl_http_destination_provider=>create_by_comm_arrangement(
comm_scenario = 'Z_INT_SUITE_OUTBOUND' ).
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( iv_path ).
lo_request->set_header_field(
i_name = 'Content-Type'
i_value = 'application/json' ).
lo_request->set_text( iv_payload ).
DATA(lo_response) = lo_client->execute( if_web_http_client=>post ).
DATA(lv_status) = lo_response->get_status( )-code.
lo_client->close( ).
IF lv_status >= 200 AND lv_status < 300.
rv_response = lo_response->get_text( ).
RETURN.
ELSEIF lv_status >= 500.
" Server-Fehler: Retry
lv_retries = lv_retries + 1.
IF lv_retries < c_max_retries.
cl_abap_session_context=>sleep( lv_delay ).
lv_delay = lv_delay * 2. " Exponentielles Backoff
ENDIF.
ELSE.
" Client-Fehler: Kein Retry
RAISE EXCEPTION TYPE cx_web_http_client_error.
ENDIF.
CATCH cx_http_dest_provider_error INTO DATA(lx_dest).
RAISE EXCEPTION TYPE cx_web_http_client_error
EXPORTING previous = lx_dest.
ENDTRY.
ENDWHILE.
" Max Retries erreicht
RAISE EXCEPTION TYPE cx_web_http_client_error.
ENDMETHOD.
ENDCLASS.

Application Logging für Integration

METHOD log_integration_call.
TRY.
DATA(lo_log) = cl_bali_log=>create_with_header(
header = cl_bali_header_setter=>create(
object = 'Z_INTEGRATION'
subobject = 'IFLOW_CALLS' ) ).
" Aufruf-Details loggen
lo_log->add_item( cl_bali_free_text_setter=>create(
severity = if_bali_constants=>c_severity_information
text = |iFlow Call: { iv_path } - Status: { iv_status }| ) ).
IF iv_status >= 400.
" Fehler-Details
lo_log->add_item( cl_bali_free_text_setter=>create(
severity = if_bali_constants=>c_severity_error
text = |Error Response: { iv_response }| ) ).
ENDIF.
" Log speichern
cl_bali_log_db=>get_instance( )->save_log( log = lo_log ).
CATCH cx_bali_runtime.
" Logging-Fehler ignorieren
ENDTRY.
ENDMETHOD.

Best Practices

ThemaEmpfehlung
AuthentifizierungOAuth 2.0 Client Credentials für Service-to-Service
FehlerbehandlungRetry für transiente Fehler, Dead-Letter für permanente
EventsIdempotente Consumer implementieren
PayloadNur notwendige Daten senden, keine gesamten Entitäten
MonitoringIntegration Suite Monitoring und ABAP Logs kombinieren
VersionierungAPI-Versionen für Breaking Changes
SecurityCredentials in Communication System, nie im Code
TestingLokale iFlow-Tests vor Produktiv-Deployment

Häufige Fehler und Lösungen

FehlerUrsacheLösung
HTTP 401Token abgelaufenToken-Endpoint und Credentials prüfen
HTTP 403Fehlende BerechtigungRollen im ABAP-System und BTP prüfen
HTTP 404iFlow nicht deployediFlow in Cloud Integration aktivieren
TimeoutiFlow zu langsamTimeout erhöhen oder asynchron verarbeiten
Connection refusedFalscher HostCommunication System Host prüfen
Certificate ErrorTLS-ProblemTrust Store konfigurieren

Weiterführende Themen