Skip to Content

Create Communication Objects for a Remote OData Service

test
0 %
Create Communication Objects for a Remote OData Service
Details

Create Communication Objects for a Remote OData Service

Requires Customer/Partner License
November 26, 2020
Created by
February 25, 2020
Create an inbound communication scenario, arrangement, system, and user in the provisioning system of SAP Cloud Platform, ABAP Environment.

You will learn

  • In the provisioning system: How to expose a CDS view as an OData service using a Service Binding
  • How to wrap this OData service in an inbound communication scenario, so that it can be accessed from another instance of SAP Cloud Platform, ABAP environment
  • How to make the provisioning system available for connection from other ABAP systems
  • How to test your service URL in Postman (optional)
  • In the client system: How to create a new destination with an HTTP connection, pointing to the provisioning system

Prerequisites

This involves some overhead for one consumer; however, the advantage is that you can add several consumer systems, or users (for example, with different authentication) pointing to the same HTTP service, wrapped in the same Communication Scenario.

step9-create-comm-artefacts-overview

.
.

Mission Scenario:

You want to get data that is only available in a remote instance of SAP Cloud Platform, ABAP Environment ( provisioning system ) and display it in a second instance ( client system ).

You need to:

  1. Create inbound communication artefacts for an OData Service in the provisioning system
  2. Create a Service Consumption Model, and save this locally as a $metadata XML file; From this you will create proxy artefacts in the client system, representing the remote service, and use this model to generate an abstract entity
  3. Create a Remote Client Proxy
  4. Build a new OData service in the client system, using a CDS custom entity and query implementation class
  5. Finally, display the remote data in Fiori Elements preview in your browser
overview-cf-only
Step 1: Create inbound Communication Scenario
  1. In your provisioning system, select your package, then choose New > Other Repository Object… from the context menu.

    step9a-new-other
  2. Add the filter scen, then choose Communication Scenario, then choose Next.

    step1b-create-comm-scen-2011
  3. Add a Name: Z_WRAP_TRAVEL_XXX and Description, Inbound for Travel Remote Service, choose a transport request, then choose Finish.

Your Communication Scenario appears in a new editor.

step1c-new-comm-scen-editor

You can also see this scenario in the Project Explorer.

step1d-comm-scen-in-adt-project-explorer
Log on to answer question
Step 2: Point to OData service binding
  1. On the Inbound tab, choose Add….

    step2a-add-http-service
  2. IMPORTANT: Choose Browse. You cannot simply enter the name. Then add a filter, such as Z_BIND_T, select your service - with the ending IWSG, then choose Finish.

    step2b-browse-inbound-service
  3. Your service appears. Choose Publish Locally.

    step2c-publish-service-locally
Log on to answer question
Step 3: Create Communication System
  1. From the Dashboard Home screen, choose From Communication Management > Communication Systems.

    step3a-comm-system-tile
  2. Choose New.

    step3b-comm-system-new
  3. Enter a System ID, ZTRAVEL_XXX, and accept the default (identical) System name, then choose Create.

    step3c-comm-system-id-name
  4. In Technical Data:

  • Switch Destination Service to OFF.

  • In Host Name, enter the base URL of your provisioning system without the protocol - i.e. the URL should have 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.

  • Business System = dummy

    step3d-host-name
  1. Scroll down to Users for Inbound Communication, then create a new user by choosing the + icon.

    step13a-create-comm-user
  2. Choose New User and the Authentication Method: User name and password.

    step3e-comm-user-name
  3. Enter a name, Z_TRAVELPRO_XXX, and description, then choose Propose password, then choose Create > OK > Save. XXX is the name of the provisioning system, that is, this system. IMPORTANT: Save the proposed password to a text file, since you will need it later.

  4. Save your changes.

Log on to answer question
Step 4: Create inbound communication arrangement
  1. Open the dashboard for your system in a browser. 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.

    step11a-open-flp
  2. From Communication Management, choose Communication Arrangement. Then choose New.

    step11b-new
  3. Choose your scenario, Z_WRAP_TRAVEL_XXX from the drop-down list. Accept the default (identical) Arrangement name.

    step3c-choose-scenario
  4. From the dropdown list, choose your communication system ZTRAVEL_XXX

    step4d-choose-comm-system
  5. Save your changes.

Your Communication Arrangement should look roughly like this.
The Service URL / Service Interface = < Base URL of provisioning system > + relative path of your Inbound Service, here /sap/opu/odata/sap/Z_BIND_TRAVELS_XXX.

step6-comm-arr
Log on to answer question
Step 5: Optional: Check service URL in Postman
  1. Open Postman. In the Authorization tab, enter your authorization credentials:

    • Type = Basic Auth.
    • Username = INBOUND_TRAVELPRO_XXX
    • Password = The generated password you noted down
  2. Stick with the default GET and paste the complete path of your service, Base URL and relative path, into the input field, then choose Send.

  3. The response appears in the Body field, along with the status 200 OK.

    step7b-postman-response
Log on to answer question
Step 6: Create destination in client system

You will now open the client system and create a destination service instance there. This must be created at subaccount (not Space) level.

  1. In the client system, open the SAP Cloud Platform Cockpit of your Cloud Foundry subaccount and choose Destinations, then choose New Destinations.

    step4a-cf-cockpit-new-destination
  2. Enter the following values. Note the name, since you will be using it later:

    Field Name Value
    Name SID_XXX_HTTP, where SID = your provisioning system
    Type HTTP
    Description Connect <your_client_system> to <your_provisioning_system>
    URL <URL of inbound service without relative path (see below)>
    Proxy Type Internet
    Authentication BasicAuthentication
    User INBOUND_TRAVELPRO_XXX (i.e. from the communication system)
    Password The generated password you noted down
    step8b-new-destination-settings
  3. Check the connection:

    step8c-check-connection-sid
Log on to answer question
Step 7: Test yourself
When creating your communication system, what value should you enter under Host Name?
×

More Information

Postman: Video Tutorials


Next Steps

Back to top