📚 Architectural Blueprint

SAP Clean Core OData Client Proxy Guide

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.

1. Why Low-Level HTTP Clients Fail Clean Core

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):

2. Architectural Workflow: Service Consumption Model (SCM)

The Clean Core consumption pattern follows an automated 3-stage pipeline:

  1. Metadata Import: The remote service EDMX or OpenAPI specification is imported into Eclipse ADT as a Service Consumption Model.
  2. Proxy Generation: ADT automatically generates ABAP dictionary types (DTOs) for all entity types, complex types, and entity sets.
  3. Execution via Client Proxy: ABAP code uses fluent request builders (create_request_for_read, set_filter, execute) to communicate with the remote endpoint.

3. BTP Destination Resolution & Token Exchange

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 ).
🔑 Zero Hardcoded Credentials

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.

4. Type-Safe Filter Construction

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 ).

Interactive OData Client Proxy Code Generator

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