REST API SAP S/4 HANA Integration

Add Data Source with HANA Basic Authentication

Follow below steps to add Data Source with HANA basic authentication:

  1. Go to Connections.

  2. On Data Sources tab, click on Add button. Add New Connection pop up will show.

  3. On Add New Connection, add below details:

    1. Add the name of the new connection you want to add under Connection Name.

    2. Under Connection Type, select REST API.

    3. Provide the Site URL.

    4. Under Authentication, select SAP HANA Basic.

    5. Add credentials as per Authentication scheme.

    6. Enable System Credentials to use the credentials provided here, for Authentication.

    7. Select a Date Format Type.

    8. Click on Save.

Add Data Connection in Form Solution

  1. Go to Solutions.

  2. Select a Solution and click on Edit Solution.

  3. On the composer, click on Add Data Connection.

  4. On Add Data Connection pop up, add the below details:

    1. Provide Name of the Data Connection.

    2. For type select REST API .

    3. Under Connection, select the Data Source created above.

    4. API URL by default, shows the Base API URL, as defined while creating the Data Connection. You can click on the three dots and use URL Builder to add parametrized URL.

    5. Under HTTP operations, select a value as per current API connection usage. REST API uses HTTP Verb to specify the request type i.e. Read / Update / Delete or Create.

    6. Under API Input Schema, click on Browse and provide JSON schema either from File or by directly copying to Text field. Input schema is of the data, that will be sent to API (i.e. Request payload in JSON).

    7. Under API Output Schema, click on Browse and provide JSON schema either from File or by directly copying to Text field. Output schema is of the data that will be received from the API (i.e. Response payload in JSON).

    8. Under API Error Schema, click on Browse and provide JSON schema either from File or by directly coping to Text field.

    9. Under Request Header, specify the expected request headers as per API specification in key value pair.

    10. Under Response Header, Specify the expected response headers as per API specification in key value pair.

    11. Click OK.

  5. After adding the schema, we will create field mapping. This step is for mapping the API solution Data Connection Data fields with Form fields. It is same as mapping of “Web Service” or “Reference Data connection” fields with Form fields.

    1. Right click on Solution Data connection created above and choose Create Field Mapping.

    2. On Field Mapping dialog, add below details:

      1. Description: A text note for this mapping.
      2. Group Name: Group name for Form schema fields. All Form fields will be created within this group.

      3. Web Service Name: A mapping name which will be used in Form control or plugins.

      4. Select an Operation.

      5. Click Next on this dialog.

    3. The Field Mapping Parameters dialog will show all API Solution Data connection fields and Form fields, similar to what is shown for Web Service field mapping dialog.

      Review or change the form field type or max length as per requirement.

    4. Click OK to complete the mapping.

  6. Once the fields are created, they can be dragged in the composer to generate form fields, buttons and web service control.

Design the Form

Design the Form with the fields created and mapped to API Solution Data connection. Also put Form controls (i.e. Web Service, lookup, query or dropdown) which will execute the API Data connection.

  1. Design the Form fields on Form View.

  2. Place the Web Service and Button control on Form view. Configure the Web service control and button control to run the API solution data connection upon clicking this button.

  3. Deploy the solution.

Note: API Solution Data connection will be on same design of other Data connections and can be used with supported Form controls and Plugins.

Test the API Solution Data connection

Launch the form and run the API Solution Data connection.

  1. Launch the Form.

  2. Click on the configured button to run the API Solution Data connection.

  3. Form will execute the API and will show the response data on mapped Form fields.