In this article I want to show you how to connect you SAP S/4HANA Cloud system to SAP HANA Cloud Platform (HCP) to build extension apps.

SAP S/4HANA Cloud provides predefined SAP services (for example various services from the Cloud Marketing Edition and services from the Enterprise Edition such as Project Maintenance). As of 1608 you can also define custom services that you can use on HCP.

Before you go into the details, you should consider:

  1. You need a valid HCP account. You can connect multiple HCP account to an SAP S/4HANA Cloud system and vice versa. In other words, HCP account and SAP S/4HANA Cloud system can be connected with a cardinality of n:m.
  2. You need no cloud connector for the connection from SAP S/4HANA Cloud system to HCP.
  3. For an S/4HANA Cloud (on premise) system or SAP Business Suite system this has been described in many articles (see for example: https://blogs.sap.com/2016/02/01/unlock-the-business-suite-with-sap-hana-cloud-platform-sap-teched-lecture-of-the-week/ and in the documentation on SAP Cloud Connector

The remainder of this article consists of three parts (plus prerequisites):

  1. The setup of the connection between your SAP S/4HANA Cloud account and your HCP account (one-time activity per SAP S/4HANA Cloud account and HCP account)
  2. The configuration of a new service that shall be used in your HCP account (activity per service)
  3. One example how to consume the exposed service on HCP (with SAP Web IDE).

0. Prerequistes

  1. SAP S/4HANA Cloud: In the Maintain Business User Fiori app, assign a business role with the business catalog Communication Management and Extensibility to the user that is going to do the setup. As a result, the user will see the following Fiori apps
    1. Maintain Communication Users
    2. Communication Systems
    3. Communication Arrangements
    4. Custom Communication Scenarios
  2. HCP: You have administration access the HCP account

1. Setup of the SAP S/4HANA Cloud – HCP Connection
The setup consists of two parts

  • SAP S/4HANA Cloud: creation of the communication system and user
  • HCP: creation of the destination

To create the communication system and communication user in SAP S/4HANA Cloud:

  1. Open the Fiori app Communication Systems, create a new communication system (you can name it for example HCP).
  2. In section User for Inbound Communication, create a new communication user (you can name it for example HCP). Enter a password or let the system create one. You can also use a certificate.
  3. All remaining fields, such as Contact person, E-Mail, Phone, etc. are optional.
  4. Save the new communication system, and check that the status says Active.

For additional documentation on the named Fiori apps, see the official user documentation: https://cp.hana.ondemand.com/dps/d/preview/1a93686c176845f0832a2a73221dd90b/1608%20500/en-US/frameset.htm?95d496fad8bc4a5ebf6b6a77a9eb616d.html

To create of the destination in HCP:

  1. Open your HCP account, go to Connectivity, Destinations
  2. Create a new destination with the following attributes:
  • Name: choose a name for example “S4HANA”
  • Type: HTTP (this includes HTTPS, which is used)
  • Description: choose a description for example “S4HANA”
  • URL: enter the URL of you S/4HANA account, for example “https://myserver.s4hana.ondemand.com”
  • Proxy Type: Internet
  • Authentication: BasicAuthentication
  • User & Password: enter the user / pwd you created before, for example “HCP”
  • Check “Use default JDK truststore” for security settings
  • Only if you want to use Web IDE (see section 3, below), set the Additional Properties:
    • WebIDEEnabled: true
    • WebIDESystem: name of the system, e.g. “S4HANA”
    • WebIDEUsage: odata_gen

Screenshot: HCP Cockpit: Destination Configuration

For additional documentation on HCP destinations, see the official user documentation: https://help.hana.ondemand.com/help/frameset.htm?1e110da0ddd8453aaf5aed2485d84f25.html

Result: Your SAP S/4HANA Cloud account and your HCP account are now connected.

2. Expose a SAP S/4HANA Cloud Service So That It Can Be Used in HCP
Before we describe how to configure a SAP S/4HANA Cloud service for HCP, I would like to give an overview which services can be configured for HCP:

  • Predefined SAP services: for example various services from the Cloud Marketing Edition and services from the Enterprise Edition such as Project Maintenance.
  • Custom services: as of version 1608 you can expose Custom Business Objects as service on HCP. As of version 1702 you can expose Custom CDS Views as external services. For details see: https://blogs.sap.com/2015/09/30/the-key-user-extensibility-tools-of-s4-hana/

To find the predefined SAP services, you can check the SAP API Business Hub https://api.sap.com/, select SAP S/4HANA Marketing Cloud or SAP S/4HANA Cloud. (Note: As far as I can see, not all available services are registered there yet. You can see all services in the system in the Communication Arrangement app, see below.)


Screenshot: SAP API Business Hub showing the details of a S/4HANA cloud service

To expose a predefined SAP S/4HANA Cloud service to be used in HCP:

  1. Open the Fiori app Communication Arrangement, create a new communication arrangement.
  2. Select an SAP communication scenario from the list. A communication scenario represents one or more predefined SAP services. For example, you could select “SAP_COM_0004: Marketing – Business Data Integration”. As mentioned, in the list you may find more services than already documented in the SAP API Hub.
  3. Select the communication system that you created in the setup step, for example “HCP”.
  4. Save the new communication system, and check that the status says Active.

As an example, see the following screenshot.

Screenshot: Communication Arrangment Fiori app

Result: The selected services are now available in HCP under destination you created before (for example “S4HANA”). In the communication scenario screen, you can find the service URL that you can use in HCP to access the service.

To configure a custom service to be used in HCP:

  1. Open the Fiori app Custom Communication Scenarios, create a new Communication Scenario.
  2. Enter a name and description, for example the name of the custom service.
  3. Click the “Add” button. In the selection list, all custom business objects are shown. Select a custom business object that you want to expose as external service. In the future, also custom CDS views and custom analytical queries will be available here.
  1. Save and publish the new communication scenario, and check that the status says Published.
  2. Continue with the procedure as described for predefined SAP S/4HANA Cloud service.

For additional documentation on the named Fiori apps, see the official user documentation: https://cp.hana.ondemand.com/dps/d/preview/1a93686c176845f0832a2a73221dd90b/1608%20500/en-US/frameset.htm?95d496fad8bc4a5ebf6b6a77a9eb616d.html

Result: The selected service is now available in HCP under the destination you created before (for example “S4HANA”).

What happens “under the hood”? By creating a communication scenario, you assign an authorization role to the communication user of the related communication system. For a SAP-defined communication scenario, the role already exists in the system. For a custom service, the authorization role is created when publishing the custom communication scenario.

3. Use the Service in HCP
You can use a service in HCP in many different way. You can use it to build a new UI, you can call it in your Java or JavaScript coding, you can use it in HANA Cloud Integration iFlows. Here I want to show only one simple use case on how to consume it: SAP Web IDE.

  1. Start SAP Web IDE. (From you HCP account dashboard, select Services, search for SAP Web IDE, click Open SAP Web IDE.)
  2. Select: File, New, New Project from Template.
  3. Select for example SAP Fiori Master Detail Application.
  4. Enter a name for a project
  5. On the step Data Connection, select Service URL. Select the destination you created before and the relative path of the OData service, as given in the Communication Arrangement screen. You can now discover the details of the service and you can even discover the live data (see the screenshot below)
  6. Continue with the creation wizard to create a Fiori app out of the OData service.

Screenshot: Consuming the exposed service in SAP Web IDE


Result: The exposed service is used in a Fiori app running on HCP.

To report this post you need to login first.

4 Comments

You must be Logged on to comment or reply to a post.

  1. Simon Kemp

    Hi Thomas,

    I followed your guide but am getting a “500 Internal Server Error” in the WebIDE. Is there some way I can debug/work out what is going wrong?

    Thanks
    Simon

    (0) 
  2. Thomas Schneider Post author

    Hi Simon,

    sorry for the late response. I assume that the S/4HANA is a Cloud system. in this case, you have no debugging option. Have you tested the URL that is provided in the Communication Arrangment Fiori app   (see screenshot in my post) directly in a browser? If you also get an error in the browser, the error is on the S/4HANA side. If it is okay in the browser, then the configuration on the HCP side is errorous. On the other hand: the name of the OData service looks strange. The “CPD” part of the name looks strange.

    (0) 
  3. Mourad Mourad

    Hello Thomas,

    I am trying to deploy a java application that connects to an SAP Marketing Cloud system, are there any examples on how to use the HCP destinations in a java application?

     

    Thanks,

    Mourad

     

     

    (0) 

Leave a Reply