A definitive guide to consuming external REST/OData APIs in ABAP Cloud using Service Consumption Models, BTP Destination resolution, and type-safe Client Proxy request builders.
In legacy ABAP, calling external services involved manual JSON string concatenation, unreleased HTTP classes (IF_HTTP_CLIENT), and hardcoded RFC destinations (transaction SM59).
In ABAP Cloud (Language Version: ABAP for Cloud Development):
SM59 RFC destinations are blocked.The Clean Core consumption pattern follows an automated 3-stage pipeline:
create_request_for_read, set_filter, execute) to communicate with the remote endpoint.All remote endpoints must be defined in the SAP BTP Cockpit as HTTP Destinations. In ABAP Cloud, destinations are resolved dynamically:
DATA(lo_dest) = cl_http_destination_provider=>create_by_cloud_destination(
i_name = 'S4HANA_CLOUD_EXT_API'
i_service_instance_name = 'destination' ).
DATA(lo_http_client) = cl_web_http_client_manager=>create_by_http_destination( lo_dest ).
The BTP Destination Service automatically handles OAuth2 client credential flows, SAML2 Bearer token exchange, or Cloud Connector reverse-proxy tunneling without exposing passwords or keys inside ABAP source code.
Never build query strings like ?$filter=Status eq 'O' manually! Use the Client Proxy Filter Factory:
DATA(lo_ff) = lo_req->create_filter_factory( ).
DATA(lo_filter) = lo_ff->create_primitive(
iv_property_path = 'OverallStatus'
iv_operation = /iwbep/if_cp_filter_types=>gcs_operator-equal
iv_value = 'APPROVED' ).
lo_req->set_filter( lo_filter ).
Generate type-safe OData V2/V4 client proxies, BTP destination binders, and unit test doubles with our free interactive architect.
🌐 Launch OData Client Proxy Architect