Skip to main content

Example

What you'll build​

Build an integration workflow that connects to an SAP S/4HANA system and retrieves selected code sets. The workflow calls the Characteristic Attribute Catalog - Read (A2X) API and logs the result as JSON.

Operations used:

  • listA_CharcAttribSeldCodeSets : Reads the selected sets of the characteristic attribute catalog from the SAP S/4HANA system, returning the first 10 results

Architecture​

Prerequisites​

  • Access to an SAP S/4HANA Cloud system with a communication user assigned to the communication arrangement this connector needs (see the Setup Guide)

Setting up the SAP Characteristic Attribute Catalog integration​

New to WSO2 Integrator? Follow the Create a New Integration guide to set up your integration first, then return here to add the connector.

Adding the SAP Characteristic Attribute Catalog connector​

Step 1: Open the connector palette and search for the connector​

Select Add Artifact, then select Connection to open the connector palette. Search for api_charcattributecatalog_srv and select the Api_charcattributecatalog_srv connector card.

Add Connection palette open with the search field before any selectionAdd Connection palette open with the search field before any selection

Configuring the SAP Characteristic Attribute Catalog connection​

Step 2: Fill in the connection parameters​

Enter the connection parameters, binding each field to a configurable variable:

  • Config : ConnectionConfig record with Basic Authentication credentials; switch to Expression and enter {auth: {username: sapS4HanaUsername, password: sapS4HanaPassword}}
  • Hostname : SAP S/4HANA API hostname; bind to the sapS4HanaHostname configurable variable
  • Connection Name : Keep the default apiCharcattributecatalogSrvClient
SAP Characteristic Attribute Catalog connection form filled with configurable variables before savingSAP Characteristic Attribute Catalog connection form filled with configurable variables before saving

Step 3: Save the connection​

Select Save Connection. The connection appears under Connections in the project tree and on the design canvas.

Design canvas showing the saved apiCharcattributecatalogSrvClient connectionDesign canvas showing the saved apiCharcattributecatalogSrvClient connection

Step 4: Set actual values for your configurables​

  1. In the left panel, select Configurations.
  2. Set a value for each configurable listed below:
  • sapS4HanaHostname (string) : The API hostname of your SAP S/4HANA Cloud system, for example, my123456-api.s4hana.cloud.sap
  • sapS4HanaUsername (string) : The communication user name
  • sapS4HanaPassword (string) : The communication user password

Configuring the SAP Characteristic Attribute Catalog listA_CharcAttribSeldCodeSets operation​

Step 5: Add an automation entry point​

Select Add Artifact, then select Automation and select Create to add the automation entry point to the canvas.

Step 6: Select and configure the listA_CharcAttribSeldCodeSets operation​

  1. On the automation canvas, select the + button to add a step.
  2. Expand the apiCharcattributecatalogSrvClient connection under Connections.
apiCharcattributecatalogSrvClient connection expanded in the node panel showing the available operationsapiCharcattributecatalogSrvClient connection expanded in the node panel showing the available operations
  1. Select List A Charc Attrib Seld Code Sets (listA_CharcAttribSeldCodeSets) and configure it:
  • $top : Under Advanced Configurations, set to 10 to limit the results to the first 10 records
  • Result : Set the result variable name to result
listA_CharcAttribSeldCodeSets operation form with $top set to 10listA_CharcAttribSeldCodeSets operation form with $top set to 10
  1. Select Save to add the operation to the flow, then add a Log Info step after it that logs result.toJsonString() in Expression mode.
Completed automation flow with the listA_CharcAttribSeldCodeSets operation and a log stepCompleted automation flow with the listA_CharcAttribSeldCodeSets operation and a log step

Try it yourself​

Try this sample in WSO2 Integration Platform.

Deploy to Devant

View source on GitHub

More code examples​

The SAP S/4HANA Quality Management Ballerina connectors provide practical examples illustrating usage in various scenarios. Explore these examples, covering use cases like syncing inspection master data to a database and creating inspection lots from paper delivery notes.

  1. S/4HANA to Database Integration - Read master inspection characteristics from S/4HANA and sync them to a MySQL database.

  2. Paper Delivery Note to S/4HANA - Extract data from a paper delivery note with OCR and create an inspection lot in S/4HANA to start the quality inspection.