Skip to Content

Prepare Consuming System and Service Consumption Model

Requires Customer/Partner License
In the consuming system, create the necessary artifacts for remote communication; then create a service consumption model from an XML metadata file; then test your connection to the provisioning system using an ABAP Console app.
You will learn
  • In the consuming system: How to create a new destination with an HTTP connection, pointing to the provisioning system
  • How to create proxy artifacts representing the remote service, using the metadata file you created previously
julieplummer20Julie PlummerJanuary 18, 2024
Created by
julieplummer20
March 9, 2023
Contributors
julieplummer20

Prerequisites

This tutorial mission was written for SAP BTP ABAP Environment. However, you should also be able to use it in SAP S/4HANA Cloud Environment in the same way.
The tutorial is based on:

Throughout this tutorial, replace ### or 000 with your initials or group number.

  • Step 1
    1. As in the previous tutorial, create a package in your ZLOCAL package, this time in the consuming system: Z_OUTBOUND_ODATA_###.

    2. Create a new transport request.

    3. Add it to Favorite Packages.

  • Step 2
    1. Select your package and choose New > Other Repository Object… from the context menu.

    2. Add the filter outbound, choose Outbound Service, then choose Next.

    3. Enter the following, then choose Next.

      • Outbound Service: Z_OUTBOUND_ODATA_###
      • Description: Get data from remote service via OData
      • Service Type: HTTP Service
        step1b-outbound-service-details
    4. Choose the transport request, then choose Finish.

    Your service appears in a new editor. The system adds the suffix _REST automatically.

  • Step 3
    1. Select your package and choose New > Other Repository Object… from the context menu.

    2. Add the filter scen, choose Communication Scenario, then choose Next.

    3. Enter the following, choose a transport request, then choose Finish.

      • Name: Z_OUTBOUND_ODATA_CSCEN_###
      • Description Get data from remote service via OData


        Your Communication Scenario appears in a new editor.
        step2a-new-outbound-comm-scen
    4. On the Overview tab, select Allowed Instances: One instance per client.

    5. On the Outbound tab, add the authorization type Basic.

    6. Then, in the Outbound Services panel, choose Add….

      step2b-add-outbound-service
    7. Browse for your service, Z_OUTBOUND_ODATA_###_REST, (the suffix REST is added automatically), then choose Finish.

      The Communication Scenario appears in a new editor.

    8. Choose Save, then choose Publish locally.

      step2c-publish-comm-scen
  • Step 4
    1. In Fiori launchpad, open the app Communication Systems, then choose New.

      step3a-comm-sys



      step3b-new-comm-sys

    2. Enter a system ID, then accept the (identical) system name:

      • Z###_TO_PRV_CSYS where PRV is the name of your provisioning system
        step3b-new-comm-sys-id-name

    1. In Technical Data:

      • Switch Destination Service to OFF.

      • In Host Name, enter the base URL of your provisioning system in the form <GUID>.abap.<region>.hana.ondemand.com. Again, you can find the URL for the dashboard by selecting your system (that is, ABAP Project in Project Explorer), then choosing Properties > ABAP Development from the context menu.

        IMPORTANT:


        Remove the protocol (e.g. https://) from the start and / from the end of the host name.


        Make sure the domain starts with abap, not abap-web

      • Port = 443

      step3c-comm-sys-general
    2. In Users for Outbound Communication, add a new user by choosing the + symbol.

      step3d-add-comm-user
    3. Choose the authentication method User Name and Password.

    4. From the dropdown, choose the user from the provisioning system, INBOUND_TRAVELPRO; paste the password you generated previously (if necessary); then choose Create.

      select-comm-user
    5. Choose Save.

  • Step 5
    1. Similarly, open the app Communication Arrangements, then choose New.

    2. From the dropdown, choose your Communication Scenario, Z_OUTBOUND_CSCEN_###; accept the generated (identical) Arrangement Name, then choose Create.

    3. From the dropdown, select your Communication System.

    4. The system fills in the User Name and Outbound Service automatically. Choose Save.

      step11c-comm-arr-complete
    5. In the Outbound Services panel, check the connection.

      step11d-check-connection

    You should get a result like this.

    step11d-ping-successful
  • Step 6

    You will now create the Service Consumption Model in ADT, using the EDMX file - i.e. the $metadata.xml file that you stored locally.

    1. Select your package and choose New > Other ABAP Repository Object from the context menu.

    2. Enter the filter text service and choose Service Consumption Model.

    3. Enter the following and choose Next.

      • Name: Z###_MODEL_TRAVELS
      • Description Model for Z_C_TRAVEL_U_SIMPLE_###
      • Remote Consumption Mode: OData
      step5a-scm-new
    4. Using Browse…, navigate to your $metadata file, choose Open, enter a Class Name, then choose Next.

      step5b-scm2-metadata
    5. The Entity Set and Entity Type appear; choose Next.

      step5c-entity-set

    5 Choose ETag Support, then choose Next.

    1. Choose the above transport request and choose Finish.

    The Service Consumption Model appears in a new editor, showing the model class, entity set name, and sample code for 5 basic operations.

    step5d-scm2-editor

    You will later create an ABAP class based on the operation Read List. The class will display the retrieved data to an ABAP Console application, then to a Fiori Elements preview.

  • Step 7

    Which file format does the OData SCM wizard require?

  • Step 8
Back to top