Skip to Content

Integrate SAP BTP, ABAP environment and SAP S/4HANA Cloud, public edition using Basic Authentication

Expose the Business Partner (A2X) OData service in SAP S/4HANA Cloud, public edition and create a communication user to access this service. Consume the same service from SAP BTP ABAP environment using Basic Authentication as the authentication method.
You will learn
  • How to perform communication management for both inbound and outbound connectivity.
  • How to use a technical communication user to authenticate using Basic Authentication.
AchimSeubertAchim SeubertAugust 1, 2025
Created by
AriannaMussoBarcucci
November 29, 2023
Contributors
AriannaMussoBarcucci
Liebherr
AchimSeubert

Prerequisites

  • This is the second tutorial of this tutorial group. Please complete the tutorial Implement an Outbound Service Call in SAP BTP ABAP environment before proceeding. The prerequisites of the previous part apply.
  • To access communication management apps, your business user has to be assigned to a business role containing business catalog SAP_CORE_BC_COM, e.g. business role SAP_BR_ADMINISTRATOR. This must be done in the following systems:
    1. The SAP BTP, ABAP environment system
    2. The customizing tenant (100) of the SAP S/4 HANA Cloud, public edition development system
  • To access the Manage Business Partner Master Data in the SAP S/4 HANA Cloud, public edition system, your business user in the customizing tenant (100) has to be assigned to business role SAP_BR_BUPA_MASTER_SPECIALIST. Thus you are able to test the implementation.

In this tutorial, all activities on S/4HANA Cloud side will be performed in the customizing tenant (100) of your development system.

  • Step 1

    Create a communication user in SAP S/4HANA Cloud, public edition. This technical user will be used for the inbound connectivity of SAP S/4HANA Cloud, public edition and outbound connectivity of the SAP BTP, ABAP environment.

    1. Open the SAP Fiori Launchpad of the customizing tenant (100) of your SAP S/4HANA Cloud, public edition development system.

    2. Access the Maintain Communication Users app

    3. Choose button New

    4. Provide User NameZBPA2X_COM_USER and DescriptionCommunication User to create Business Partners

    5. Choose button Propose Password

    6. Store proposed password for later use.

      Create Communication User
    7. Choose button Create

  • Step 2

    Create a communication system in SAP S/4HANA Cloud, public edition. This is used to model the external communication partner and to specify the authentication methods and users which are allowed.

    1. Access the Communication Systems app

    2. Choose button New

    3. Provide System ID ZBPA2X_COM_SYS and System Name ZBPA2X_COM_SYS

      Create Communication System
    4. Choose button Create

    5. In the Section General tab provide the following information:

      1. Logical System: ZBPA2X
      2. Business System: ZBPA2X
      3. Choose Inbound Only

        Inbound only

    6. In the Users for Inbound Communication tab provide the following information:

      1. Choose + to add an Inbound User
      2. Choose Authentication Method: User Name and Password
      3. Provide User Name / Client ID: ZBPA2X_COM_USER
      4. Choose button OK

        Users for Inbound Communication

      5. The result is that the user created in the previous step is now added as inbound communication user

        Users for Inbound Communication

    7. Choose Save to save the communication system.

  • Step 3

    Create a communication arrangement based on the communication scenario SAP_COM_0008 in SAP S/4HANA Cloud, public edition. The Business Partner (A2X) API is part of this standard scenario. You will use the previously created communication system and user, thus defining how to authenticate and authorize against the exposed service.

    1. Access the Communication Arrangements app

    2. Choose button New

    3. Choose Scenario SAP_COM_0008

    4. Provide Arrangement Name: ZBPA2X_CA_INBOUND

    5. Choose button Create

      Create Communication Arrangement
    6. On the next screen provide the following information:

      1. Communication System: ZBPA2X_COM_SYS. For inbound communication the User Name and Authentication Method is set automatically from the communication system.

        Create Communication Arrangement 2

      2. Store API-URL for later use
      3. Deactivate all Outbound Services. Explanation: The outbound services are used to support a different scenario, which is to synchronize business partners between SAP S/4HANA systems via SOAP. This is not done in this tutorial. We are using the service to expose it as an API. ( Business Partner (A2X) ). Example for a deactivated Outbound Service:

        Deactivated Outbound Service

      4. Choose Save

    You can download the metadata of the service also in the communication arrangement. This is helpful in case you extended the API with custom fields. To download the metadata, navigate to Inbound Services and choose Download WSDL/Service Metadata:

    Download Metadata Alternative

  • Step 4

    Configure the outbound connectivity in SAP BTP, ABAP environment. Create a communication arrangement based on your custom communication scenario, as well as a communication system and an outbound communication user. The communication system will contain the target host of the SAP S/4HANA Cloud, public edition system, while the communication user will need to match the inbound user defined in the target system.

    1. Open SAP Fiori Launchpad of your SAP BTP ABAP environment system.

    2. Access the Communication Arrangements app

    3. Choose button New

    4. Choose Scenario ZBPA2X_CS_BUPA created before

    5. Provide Arrangement Name: ZBPA2X_CA_OUTBOUND

    6. Choose button Create

      Create Communication Arrangement - ABAP system
    7. Choose button New to create a new Communication System

      Create Communication System - ABAP system
    8. Provide:

      1. System ID: ZBPA2X_COM_SYS_S4H
      2. System Name: ZBPA2X_COM_SYS_S4H

        Create Communication System - ABAP system 2

    9. In the Communication System screen, General section, provide:

      1. Host Name: API-URL stored in STEP 3. Remove the https:// from the URL.
      2. Business System: ZBPA2X

        Communication System - General

    10. In the Users for Outbound Communication section

      1. Choose +
      2. Provide User Name / Client ID: User created in STEP 1 (ZBPA2X_COM_USER)
      3. Provide Password: Password created and stored in STEP 1

        Users for Outbound Communication

      4. Choose button Create

    11. Choose Save to save the Communication System

    12. Verify the Authentication Method is User ID and Password

      Verify Authentication Method
    13. Choose Save to save the Communication Arrangement

    You have now successfully integrated SAP BTP, ABAP Environment and your SAP S/4HANA Cloud, public edition system using Basic Authentication.

  • Step 5

    As a developer in SAP BTP, ABAP environment, you can now execute the console application.

    1. In ADT, open the project for your SAP BTP ABAP environment system.

    2. Navigate to the Console Application ZBPA2X_CL_CLASSRUN

    3. Right click on the class and choose Run As > ABAP Application (Console)

    4. Note down the Business Partner number that is written to the Console for later use

      Business partner number
  • Step 6

    You should now verify that the business partner was successfully created in your SAP S/4HANA Cloud, public edition system.

    1. Open the SAP Fiori Launchpad of the customizing tenant (100) of your SAP S/4HANA Cloud, public edition development system.

    2. Access the Manage Business Partner Master Data app

    3. Enter the previously created Business Partner number in the related field and press enter.

      Verify Business partner creation
    4. Display column Created By via the settings button.

      Verify Business partner creation 2
      Verify Business partner creation 3
    5. Check the data of the created business partner. See that the user was created by the technical communication user, and not by your own business user:

      Verify Business partner creation 4

    You have now verified that the integration of SAP BTP, ABAP environment and your SAP S/4HANA Cloud, public edition system, which uses Basic Authentication as the authentication mechanism, indeed works.

    You saw that the business partner was created by the technical communication user, and not by your own business user. In fact, you do not even require a business user in the S/4HANA Cloud system for the remote service call to succeed. The communication user receives the necessary authorization for creating business partners via the communication arrangement for scenario SAP_COM_0008.

  • Step 7

    Where do you need to create an user for inbound communication?

Back to top