## 5.6.2.3.2.1  Create an SAP S/4HANA Extensibility Service Instance in the Cloud Foundry Environment
Use this procedure to configure the communication between SAP S/4HANA Cloud and SAP Event Mesh.
## Prerequisites
- Before creating an SAP S/4HANA Cloud Extensibility service instance in the Cloud Foundry environment, see Create a Service Instance to Consume the SAP S/4HANA Cloud APIs [page 2115].
- Have enabled Cloud Foundry environment for your subaccount. See Enable Environment or Create Environment Instance [page 2255].
- Have registered an SAP S/4HANA Cloud system. SeeRegister an SAP S/4HANA Cloud System in a Global Account in SAP BTP [page 2048].
- Have configured the entitlements to the SAP S/4HANA Cloud Extensibility service. See Configure the Entitlements for the SAP S/4HANA Cloud Extensibility Service [page 2114].
## Context
To configure the connectivity between the SAP S/4HANA Cloud tenant and Event Mesh and to enable the exchange of credentials between the two systems, you first need to create an SAP S/4HANA Cloud Extensibility service instance with service plan messaging . For more information about the messaging service plan, see Supported Service Plans for SAP S/4HANA Cloud [page 2166].
When creating this service instance, you create the required configurations in both the SAP S/4HANA Cloud tenant and the Event Mesh system associated with the subaccount in SAP BTP, so that events can flow.
## Procedure
1. In the SAP BTP cockpit, navigate to the subaccount in which you want to create a service instance.
2. In the navigation area, choose Services Service Marketplace .
All services available to you appear.
3. To enable the integration with an SAP S/4HANA Cloud system that you have registered in the global account in SAP BTP, choose SAP S/4HANA Cloud Extensibility .
4. In the SAP S/4HANA Cloud Extensibility page, choose Create .
5. In the New Instance or Subscription wizard:
- a. In the Service dropdown list, ensure you have selected the SAP S/4HANA Cloud Extensibility service.
- b. In the Plan dropdown list, select the messaging service plan.
- c. In the Runtime Environment dropdown list, select Cloud Foundry .
- d. In the Space dropdown list, select your space. If you haven't create a space yet, you can do it at this point.
- e. In the System Name dropdown list, select the SAP S/4HANA Cloud system you have registered.
- f. In the Instance Name field, enter a name for your instance. Choose Next .
- g. Specify a JSON file or specify parameters in the JSON format to define the communication arrangement for the communication scenario Enterprise Eventing Integration (SAP\_COM\_0092) in the SAP S/4HANA Cloud tenant and to configure the parameters for the Enterprise Messaging service. If you decide to define the communication arrangement later on, you have to delete this service instance and create it again. Choose Next .
For more information about the structure of the JSON file, see Define SAP S/4HANA Cloud Extensibility Service Descriptor JSON/YAML File [page 2145].
- h. Choose Create .
The newly created instance appears in the list of instances in the Instance and Subscriptions page.
Alternatively, you can create the instance using cf CLI. To do so, execute the following command
```
cf create-service s4-hana-cloud messaging emsconnect -c '{"systemName": "<system_name>","communicationArrangement": {"communicationArrangementName": "<communication_arrangement_name>","attributes": [{"name": "Channel","value": "<channel_name>"},{"name": "Description","value": "<short_description>"}, {"name": "Topic Space","value": "<topic_to_be_used_by_events>"}, {"name": "QoS","value": "<quality_of_service>"},{"name": "Reconnect Attempts","value": "<number_of_reconnect_attempts>"}, {"name": "Reconnect wait time(sec)","value": "<time_before_trying_to_reconnect>"}]},"ems": {"parameters": {"emname": "enterprise_messaging_client_name","namespace": "enterprise-messaging_client_namespace":{"options": {<required_options>},"rules": {<required_rules>}}'
```
For more information, see Create Service Instances Using the Cloud Foundry Command Line Interface.
##  Note
You can use the cf CLI to troubleshoot if the creation of the service instance fails. To do that, use this command in the cf CLI:
cf service &lt;service\_instance\_name&gt;
## Next Steps
Configure Event Topics in SAP S/4HANA Cloud [page 2153]