Beyond ABAPdesigned by@Tejoram97
Beyond ABAP / ABAP on BTP / Communication Management & Communication Targets

Communication Management & Communication Targets

ABAP on BTP · SAP BTP ·

Open the interactive lesson →
  1. The four objects and who owns them
  2. Fiori apps, business catalogs and roles
  3. Communication users and authentication
  4. Communication systems
  5. Communication arrangements
  6. Your own communication scenarios: key user vs developer
  7. Communication targets
  8. Cloud vs on-premise / private cloud
  9. Certificates, trust and monitoring
  10. Sources
  11. Interview questions

How SAP S/4HANA Cloud Public Edition and the SAP BTP ABAP environment (ABAP Cloud) configure every connection to and from other systems – and communication targets, the recommended way to call other systems from ABAP Cloud code. Builds on ABAP on BTP › 01 (Part 6, the scenario–system–arrangement trio and the outbound code) and 02 (cloud successors: CL_HTTP_CLIENT → communication targets). All facts are from SAP Help Portal (S/4HANA Cloud 2608, ABAP Cloud) and SAP's official documentation mirror on GitHub; the source is named under each part.

Part 1 – The four objects and who owns them

Object

What it is

Who creates it

Transported?

Communication scenario

Bundles inbound and outbound services plus additional properties – *what* may be called

SAP (*Managed by SAP*, IDs SAP_COM_xxxx) or you (*Managed by Customer*: developer in ADT, or key user in *Custom Communication Scenarios*)

Customer scenarios from ADT: yes (created in DEV, transported)

Communication system

The communication partner: host name, identity, users and certificates

Administrator (Fiori)

No – created locally in each system

Communication user

A special technical user assigned to a communication system

Administrator (Fiori)

No

Communication arrangement

Describes a scenario with a remote system at configuration time – links one scenario with one system and activates it

Administrator (Fiori)

No

Recommended order:

Source: process · btp_cm · glossary · dev_flow

Part 2 – Fiori apps, business catalogs and roles

App

App ID

Use

Communication Arrangements

F1763

Create / edit arrangements; shows the service URLs

Communication Systems

F1762

Partner systems, outbound users, Cloud Connector, OAuth / SAML trust

Maintain Communication Users

F1338

Inbound technical users (password or X.509 certificate)

Display Communication Scenarios

–

All scenarios with authentication methods, services, certificates, scope items; start a new arrangement

Custom Communication Scenarios

–

Key user: own scenarios (S/4HANA Cloud Public Edition)

Maintain Certificate Trust List

F2275

Trust partner certificate authorities

Maintain Client Certificates

–

Own client certificates for outbound authentication

Display Connectivity Trace

–

Analyse inbound connectivity problems

System Outbound Communication

F4031

BTP: top 10 scenarios by calling time

App IDs marked – are not stated on the official pages read.

Source: appids · ctl_id · f4031 · catalogs · role · certx

Part 3 – Communication users and authentication

Inbound user

Outbound user

Provided by

Your system – the partner uses it to call your inbound services

The external system – your system uses it to call the partner

Created in

*Maintain Communication Users*

Directly in *Communication Systems*

Authentication

Password (basic) or X.509 client certificate on the user; token-based methods (OAuth, SAML, OIDC) via trust in *Communication Systems*

User + password, SSL client certificate, OAuth 1.0, OAuth 2.0

3.1 Inbound

3.2 Outbound

Source: users · user_create · systems · out_user · out_auth · in_sec · out_sec · scen_ac

Part 4 – Communication systems

Field / option

Meaning

Host Name

The partner host – localhost is not allowed; optional UI Host Name

Port

Default 443; Cipher Suites select the TLS version

Logical System

Alternative ID needed for IDoc communication

Business System

Alternative ID of the system in your landscape

Is Hub System

For B2B / EDI messages

Inbound Only

Hides the outbound-only fields

Cloud Connector + SSC Location ID

Reach on-premise systems; without Cloud Connector, RFC uses WebSocket RFC

OAuth 2.0 Settings

Incl. Refresh Allowed / Refresh Token Expiry for inbound OAuth users (default 2 days) and Cloud Connector technical user propagation

OAuth 2.0 Identity Provider · SAML Bearer Assertion Provider · OpenID Connect

Trust for token-based inbound authentication

Destination Service (BTP)

Host, port, user and authentication come from a BTP destination – subaccount level, or a service-instance destination (needs an arrangement for SAP_COM_0276)

Source: systems · btp_sys · btp_cm

Part 5 – Communication arrangements

5.1 Which scenario does an API need?

On the SAP Business Accelerator Hub (api.sap.com) the *Details* tab of an API lists the communication scenarios it belongs to; you can also search for a scenario to see its APIs. Examples: SAP_COM_0008 Business Partner, Customer and Supplier Integration · SAP_COM_0053 Purchase Order Integration · SAP_COM_0326 application job scheduling (replaced SAP_COM_0064, deprecated in 2511) · BTP: SAP_COM_0276 destination service instances.

Source: arr · status · certx · dispscen · hub · com0008 · com0326 · btp_sap

Part 6 – Your own communication scenarios: key user vs developer

Key user (S/4HANA Cloud Public Edition)

Developer (ABAP Cloud, ADT)

Tool

*Custom Communication Scenarios* app

ADT: New → Other ABAP Repository Object → Communication Management → Communication Scenario

Contents

ID, description, inbound and outbound services

Inbound / outbound services, authorization objects, fields and activities (administrators cannot change them), additional properties

Make usable

Publish (only published scenarios get arrangements; created in the quality system – New and Delete are inactive in production)

Publish locally (test in DEV), then transport

Outbound call in code

cl_ble_http_client=>create( communication_scenario = … outbound_service = … ) – one arrangement per client

Outbound service (HTTP) in the scenario; cl_http_destination_provider=>create_by_comm_arrangement( comm_scenario, service_id, comm_system_id ) – not usable for SAP-delivered scenarios

Source: cust_scen · cust_rules · cust_flow · ble · adt_scen · scen_ac · outbound · readapi

Part 7 – Communication targets

Communication targets are the recommended approach for outbound HTTP and RFC communication in ABAP Cloud. The code refers to a communication target instead of a concrete destination, so the same code line runs in the cloud and on-premise – the environment-specific part (where the target points to) is configured by the administrator.

Topic

Cloud (Public Edition, BTP ABAP environment)

On-premise / S/4HANA Cloud Private Edition

Where the target is resolved

An application destination is created automatically when a communication arrangement's scenario references an outbound service of type *communication target*

The application destination for the communication target is created in transaction APPLDEST, APPLDESTCS or APPLDESTCC

Who configures it

Administrator – communication arrangement

Administrator – APPLDEST transactions

Code

Same code in both environments – one shared code line

Same code in both environments

Source: ct · ct_sm59 · outbound

7.1 Create the communication target (ADT)

Source: ct · ct_create · ct_edit · ct_prefix

7.2 Link it to a communication scenario (cloud)

Source: cota_srv · outsrv · cota_ex · scen

7.3 HTTP call

Instantiate the generated class and let it create the HTTP client – there is no destination lookup in the code:

DATA lo_cota TYPE REF TO zct_example.
TRY.
lo_cota = NEW zct_example( ).
DATA(lo_client)   = lo_cota->create_web_http_client( ).
DATA(lo_response) = lo_client->execute( if_web_http_client=>get ).
DATA(ls_status)   = lo_response->get_status( ).
out->write( ls_status-code ).
out->write( ls_status-reason ).
lo_client->close( ).
CATCH cx_web_http_client_error cx_communication_target_error cx_appdestination INTO DATA(lx_error).
out->write( lx_error->get_text( ) ).
ENDTRY.

Source: http_call · http_call2 · ap_http

7.4 RFC call

DATA lo_cota TYPE REF TO zct_example_rfc.
TRY.
lo_cota = NEW zct_example_rfc( ).
DATA(lo_remote_session) = lo_cota->create_session( ).        " stateful
CALL FUNCTION 'RFC_PING' IN REMOTE SESSION lo_remote_session.
CATCH cx_communication_target_error cx_appdestination INTO DATA(lx_error).
out->write( lx_error->get_text( ) ).
ENDTRY.

Source: rfc_call · rfc_mig · kw_rfc · kw_ex

7.5 Administrator setup

Environment

What the administrator does

Cloud (Public Edition, BTP ABAP environment)

Create communication system + communication arrangement for the scenario → the application destination is created automatically. Several systems/arrangements on one scenario → several application destinations; to know their names at runtime implement BAdI COMMUNICATION_MANAGEMENT (if_com_arrangement_badi).

On-premise / Private Edition – APPLDEST

Client-specific application destinations of all clients, or cross-client ones

APPLDESTCS

Client-specific application destinations of the current client

APPLDESTCC

Cross-client application destinations

Source: ct · badi · appldest · appldest_http

7.6 Migrating from SM59

Not confirmed on the official pages read: a code sample for SELF_HTTP and whether it exists in the cloud; a method CREATE_BY_COM_TARGET mentioned once on one page but used in no sample.

Source: sm59_http · rfc_mig · grouping · arr_mig

Part 8 – Cloud vs on-premise / private cloud

SAP: in the cloud, administration is done in the communication management apps in the SAP Fiori launchpad; in on-premise and private cloud systems, administrators use the corresponding transactions.

Outbound protocol

Cloud workflow

On-premise ("home") workflow

HTTP

Communication scenario + outbound service, communication system, communication arrangement

APPLDEST (application destination)

SOAP

Same, in the communication management apps

SOAMANAGER

RFC

Same, in the communication management apps

SM59

Whether the Fiori communication management apps or communication arrangements exist in on-premise / Private Edition systems is not stated on the ABAP Cloud pages read – they only describe transaction-based administration there.

Source: onprem · workflow · ct

Part 9 – Certificates, trust and monitoring

Source: ctl · clientcert · btp_cert · trace · mmo · changedoc

Part 10 – Sources

Part 11 – Interview questions

Q1. Communication scenario, system, user and arrangement – who does what?

The scenario (SAP-delivered SAP_COM_xxxx or customer-defined in ADT / the key user app) says which inbound and outbound services may be used. The administrator creates the communication user, the communication system (the partner) and the arrangement that links scenario and system and activates it. Systems, users and arrangements are created locally in each system and are not transported; ADT scenarios are transported.

Q2. Inbound vs outbound communication user?

The inbound user is provided by your system (*Maintain Communication Users*, password or X.509 certificate – certificates recommended) and used by the partner to call you. The outbound user is provided by the partner, maintained in *Communication Systems*, and authenticates with user/password, SSL client certificate, OAuth 1.0 or OAuth 2.0 (client credentials).

Q3. How do you find which arrangement an S/4HANA Cloud API needs?

On the SAP Business Accelerator Hub, the API's *Details* tab lists its communication scenarios; then create an arrangement for that scenario (e.g. SAP_COM_0008 for business partner integration) and use the inbound URL shown in the arrangement.

Q4. What is a communication target and why use it?

It is the recommended way to call other systems over HTTP or RFC from ABAP Cloud code. The code names the target, not a destination; in the cloud an application destination is created automatically from the communication arrangement, on-premise / Private Edition the admin creates it in APPLDEST. So one code line works in both, and SM59 lookups disappear (SM59 NONE → SELF_HTTP).

Q5. How do you expose your own RAP API to an external system in the cloud?

Create a Web API service binding, add it as inbound service to a communication scenario in ADT (with its authorization values), publish locally and transport; the admin creates the communication user, system and arrangement and hands over the inbound URL. Key users on Public Edition can instead use *Custom Communication Scenarios* and publish the scenario.