CLASS /iap/chm_cl_aux_product DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
CLASS-METHODS:
get_client_proxy RETURNING VALUE(ro_client_proxy) TYPE REF TO /iwbep/if_cp_client_proxy.
PROTECTED SECTION.
PRIVATE SECTION.
CONSTANTS:
c_destination TYPE string VALUE `destination_name`.
ENDCLASS.
CLASS /IAP/CHM_CL_AUX_PRODUCT IMPLEMENTATION.
METHOD get_client_proxy.
TRY.
DATA(lo_destination) = cl_http_destination_provider=>create_by_cloud_destination(
i_name = c_destination
i_authn_mode = if_a4c_cp_service=>service_specific ).
DATA(lo_client) = cl_web_http_client_manager=>create_by_http_destination( lo_destination ).
ro_client_proxy = /iwbep/cl_cp_factory_remote=>create_v2_remote_proxy(
is_proxy_model_key = VALUE #( repository_id = ‘DEFAULT’
proxy_model_id = ‘/IAP/CHM_SCM_PRODUCT’
proxy_model_version = ‘0001’ )
io_http_client = lo_client
iv_relative_service_root = ‘/sap/opu/odata/sap/API_PRODUCT_SRV’ ).
CATCH cx_root.
ENDTRY.
ENDMETHOD.
ENDCLASS.
It is a utility class that provides a static method get_client_proxy to connect to the external OData V2 service API_PRODUCT_SRV via the BTP cloud destination iaapinc.
The method:
- Reads the cloud destination,
- Creates an HTTP client,
- Builds an OData V2 proxy (
/iwbep/if_cp_client_proxy) based on proxy model/IAP/CHM_SCM_PRODUCT, - Returns this proxy so other classes can easily consume the Product API without handling low-level HTTP setup.
👉 In short: It’s a helper to simplify access to the Product OData API in SAP BTP ABAP.