Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
ThomasSchneider
Product and Topic Expert
Product and Topic Expert
In this article I want to show you how to connect you SAP S/4HANA Cloud system to SAP Cloud Platform (SAP CP) 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 SAP CP.

Before you go into the details, you should consider:

  1. You need a valid SAP CP account. You can connect multiple SAP CP account to an SAP S/4HANA Cloud system and vice versa. In other words, SAP CP 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 SAP CP .

  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-l... 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 SAP CP account (one-time activity per SAP S/4HANA Cloud account and SAP CP account)

  2. The configuration of a new service that shall be used in your SAP CP account (activity per service)

  3. One example how to consume the exposed service on SAP CP (with SAP Web IDE).


0. Prerequisites

  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.  SAP CP : You have administration access the SAP CP account


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

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

  •  SAP CP : 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 SCP).

  2. In section User for Inbound Communication, create a new communication user (you can name it for example SCP). 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/framese...

To create of the destination in SAP CP :

  1. Open your SAP CP 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 “SCP”

  • 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: SAP CP Cockpit: Destination Configuration

For additional documentation on SAP CP 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 SAP CP account are now connected.

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

  • 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 SAP CP . 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 SAP CP :

  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 "SCP".

  4. Save the new communication system, and check that the status says Active.


As an example, see the following screenshot.



Screenshot: Communication Arrangement Fiori app

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

To configure a custom service to be used in SAP CP :

  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/framese...
Result: The selected service is now available in SAP CP 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 SAP CP
You can use a service in SAP CP 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 SAP CP 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 SAP CP .


 

Continue: SAP S/4HANA Extensibility: How to Connect Your SAP S/4HANA Cloud to SAP Cloud Platform (II): Recomme...
14 Comments