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:
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.
You need no cloud connector for the connection from SAP S/4HANA Cloud system to SAP CP .
The remainder of this article consists of three parts (plus prerequisites):
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)
The configuration of a new service that shall be used in your SAP CP account (activity per service)
One example how to consume the exposed service on SAP CP (with SAP Web IDE).
0. Prerequistes
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
Maintain Communication Users
Communication Systems
Communication Arrangements
Custom Communication Scenarios
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:
Open the Fiori app Communication Systems, create a new communication system (you can name it for example SCP).
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.
All remaining fields, such as Contact person, E-Mail, Phone, etc. are optional.
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 SAP CP :
Open your SAP CP account, go to Connectivity, Destinations
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
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.
To find the predefined SAP services, you can check the SAP API Business Hubhttps://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 :
Open the Fiori app Communication Arrangement, create a new communication arrangement.
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.
Select the communication system that you created in the setup step, for example “SCP”.
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 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 :
Open the Fiori app Custom Communication Scenarios, create a new Communication Scenario.
Enter a name and description, for example the name of the custom service.
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.
Save and publish the new communication scenario, and check that the status says Published.
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 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.
Start SAP Web IDE. (From you SAP CP account dashboard, select Services, search for SAP Web IDE, click Open SAP Web IDE.)
Select: File, New, New Project from Template.
Select for example SAP Fiori Master Detail Application.
Enter a name for a project
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)
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 .
Would you like to access Full Article?
If you are already a member in this website, Please Click here to loginIf you are not yet a member, Please Click here to Sign up
if you have any questions don’t hesitate to contact us from the Button bellow