Using Anypoint Studio to Configure SAP S/4HANA OData Connector 2.4
Anypoint Studio (Studio) editors help you design and update your Mule applications, properties, and configuration files.
To add and configure a connector in Studio:
If you are new to configuring connectors in Studio, see Using Anypoint Studio to Configure a Connector. If, after reading this topic, you need additional information about the connector fields, see the SAP S/4HANA OData Connector Reference.
Create a Mule Project
In Anypoint Studio, create a new Mule project in which to add and configure the connector:
-
From the Studio main menu, select File > New > Mule Project.
-
Enter a name for your Mule project and click Finish.
Add the Connector to Your Mule Project
Add Anypoint Connector for SAP S/4HANA OData to a Mule project to automatically populate the project’s XML code with the connector’s namespace and schema location, as well as to add the required dependencies to the project’s pom.xml
file.
-
In the Mule Palette view, click (X) Search in Exchange.
-
In Add Dependencies to Project, type
sap s/4hana odata
in the search field. -
Click the connector name in Available modules.
-
Click Add.
-
Click Finish.
Adding a connector to a Mule project in Studio does not make that connector available to other projects in your Studio workspace.
Configure a Source
A source initiates a flow when a specified condition is met. The act of dragging the connector’s operation from the palette onto the Anypoint Studio canvas automatically populates the XML code with the connector namespace and schema location.
Possible source operations for this connector are:
-
HTTP Listener
Starts your app using a browser or a command such ascurl
-
Scheduler
Starts your app at timed intervals
In Studio, drag the input operation you choose from the Mule Palette to the Source panel in the canvas, and supply the required parameters.
Add a Connector Operation to the Flow
When you add a connector operation to your flow, you immediately define a specific operation for that connector to perform.
To add an operation for SAP S/4HANA OData Connector, follow these steps:
-
In the Mule Palette view, select SAP S/4HANA OData and then select the desired operation.
-
Drag the operation onto the Studio canvas to the right of the input source.
Global Configuration Elements
To use SAP S/4HANA OData Connector in a Mule app, configure a connector global element for connector operations to use in your application.
You can put placeholder values in the mule-artifact.content
configuration file in the src/main/resources
folder of your project.
You can either enter your credentials in the global configuration content or reference a configuration file that contains the values for your credentials. Using a configuration file is recommended for simpler maintenance and better reuse of your project. Keeping these values in a separate file is useful if you need to deploy to different environments, such as production, development, and QA, where access credentials might differ.
For more information, see Use Property Placeholders for Property Values.
Configure a Global Element
Use the Global Element Properties configuration dialog to configure a global element for SAP S/4HANA OData Connector:
-
In your project, click the Global Elements tab at the base of the canvas.
-
In the Global Configuration Elements screen, click Create:
-
In the Choose Global Type wizard, expand Connector Configuration, select SAP S 4HANA Config, and click OK.
-
Configure the following values in the General tab:
-
In the Connection drop-down menu, select the connection type:
-
Basic authentication
For basic authentication, enter the following required values:-
Service Base URL
The URL of the SAP S/4HANA instance you want to manage -
Username
The user name used to initialize the session -
Password
The password used to authenticate the user
-
-
OAuth 2 Application Connection Provider
For OAuth 2.0 authentication, enter the following required information: ** *Service base URL* + The base URL of the service provider of the SAP S/4HANA system to access from the connector. All other endpoints are derived from this base URL. ** *Client ID* + The OAuth client ID that is registered with the service provider ** *Client secret* + The OAuth client secret that corresponds to the client ID and is registered with the service provider. ** *Token URL* + Token URL that corresponds to the URL of the endpoint that provides the access tokens .. Click *OK*. . Click *Test Connection* to ensure that your access credentials are correct. . Click the *Advanced* tab inside the *Connection* section to configure the following values:
Studio Field Description Discovery Service Enabled
Feature switch for service discovery. If disabled, the service discovery relative path is not applied.
Discovery Service Path
Relative path from the base URL to the service to use for automatic services discovery.
Service directory
Common HTTP directory for all SAP services. You can leave this parameter blank and then specify the HTTP directory individually for every service in the unlisted services list.
Unlisted services
List of services to add to the list of discovered services.
Service discovery resolution timeout
Connection timeout for service discovery.
Service discovery timeout unit
Time unit to use in the service discovery resolution timeout configuration.
Default headers
Custom headers that can be included in each request sent.
Default query parameter
Custom query parameters to include in each request sent.
TLS configuration
TLS configuration.
Proxy configuration
Configuration for executing requests through a proxy.
Connection timeout
Connection timeout for the request.
Connection timeout unit
Connection timeout unit for the request.
Client timeout
Client timeout for the request.
Client timeout unit
Client timeout unit for the request.
-
-
-
Click the Advanced tab in the configuration window to configure the following values:
Studio Field Description Time zone
The time zone to which the Date objects returned from S/4Hana are converted.
Batch buffer size
The maximum memory the connector can use to keep batch requests in memory. Any requests requiring additional memory are buffered on disk.
Buffer unit
The unit of measure in which the batch buffer size parameter is expressed.
Response timeout
Response timeout for the request.
Response timeout unit
Response timeout unit for the request.
-
Click OK to save the global connector configuration.
Next Step
After configuring the SAP S/4HANA OData Connector for use in Studio, see the Examples topic for more Studio information.