> For the complete documentation index, see [llms.txt](https://developer.emporix.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.emporix.io/ce/extensibility-and-integrations/integrations/sap-integration/sap-sales-quotes-integration/sap-sales-quotes-configuration.md).

# Integration Suite Configuration

This guide describes the configuration of SAP Integration Suite required to integrate transactional data between Emporix Commerce Engine and SAP S/4HANA. It delivers the general information about what needs to be configured and deployed for the integration to work.

## Prerequisites

Before you start the configuration, ensure you have the following things prepared:

* Administrative access to the [Emporix Commerce Engine tenant](/ce/getting-started/creating-a-tenant.md)
* Access token for [Emporix APIs](/ce/getting-started/developer-portal/manage-apikeys.md)
* Emporix Commerce Engine data structures set up to accommodate SAP Sales Area and related data by importing the prepared [Mixin JSON files](/ce/management-dashboard/settings/mixin-schemas.md)
* Access to SAP Business Technology Platform with an entitled SAP Integration Suite
* Access to the relevant BTP Subaccount ID and BTP Region for Cloud Connector setup
* Access to Cloud Connector
* Access to the S/4HANA tenant and IMG for customizing tasks
* SAP Gateway activated and operational
* S/4HANA server host, system number, and client available

{% hint style="info" %}
For SAP S/4HANA sales APIs and integration platform documentation, refer to:

* [APIs for Sales](https://help.sap.com/docs/SAP_S4HANA_ON-PREMISE/19d48293097f4a2589433856b034dfa5/f67705a25e2b440f90a25faaffa5ffef.html) — SAP S/4HANA on-premise sales API overview
* [SAP Cloud Integration](https://help.sap.com/docs/cloud-integration/sap-cloud-integration/sap-cloud-integration) — SAP Integration Suite platform documentation
* Business Accelerator Hub (A2X APIs):
  * [Order Simulation](https://api.sap.com/api/OP_API_SALES_ORDER_SIMULATION_SRV_0001/overview) — `API_SALES_ORDER_SIMULATION_SRV`
  * [Sales Order](https://api.sap.com/api/OP_API_SALES_ORDER_SRV_0001/overview) — `API_SALES_ORDER_SRV`
  * [Sales Quotation](https://api.sap.com/api/OP_API_SALES_QUOTATION_SRV_0001/overview) — `API_SALES_QUOTATION_SRV`
    {% endhint %}

## Emporix Commerce Engine

### Mixin setup

Import the Mixin setup for the following objects: [Category](/ce/management-dashboard/catalogs-module/categories.md), [Company](/ce/management-dashboard/customer-management/companies.md), [Customer](/ce/management-dashboard/customer-management/customers.md), [Order](/ce/management-dashboard/orders-module/orders.md), and [Product](/ce/management-dashboard/products-module/products.md).

The Mixin data structures provide an explicit space for SAP data objects. These mixins store mainly SAP Sales Area and SAP Business Partner Relationship data. The Integration flow mappings depend on this Mixin setup. Mixin data structures are imported from the provided Mixin JSON files.

{% hint style="info" %}
To import Mixin schemas in the Management Dashboard, see [Mixin Schemas](/ce/management-dashboard/settings/mixin-schemas.md). For how SAP Sales Area data is used in Emporix, see [SAP Business Partner and Sales Area on company level](/ce/extensibility-and-integrations/integrations/sap-integration/sap-sales-quotes-integration/sap-sales-quotes-process.md#sap-business-partner-and-sales-area-on-company-level).
{% endhint %}

### Webhooks

Several integration flows are triggered by Emporix Commerce Engine [webhooks](/ce/management-dashboard/administration/webhooks.md). Before deploying the related iFlows, enable and customize each webhook:

| Webhook event  | Integration flow                                                |
| -------------- | --------------------------------------------------------------- |
| `order.create` | [A2X-based Order Create](#a2x-based-order-create)               |
| `quote.create` | [A2X-based Quote Create](#a2x-based-quote-create)               |
| `quote.change` | [A2X-based Quote Status Update](#a2x-based-quote-status-update) |

## SAP Cloud Connector

Set up Cloud Connector to integrate the desired S/4HANA tenant with the related BTP Subaccount. To enable access to Gateway services, create a Cloud to On-Premise connection with an HTTP protocol system mapping and add a URL path resource to expose Gateway Services. For simplicity, you may choose the root `/` as the URL path resource.

The [RFC-based Pricing Simulation](#rfc-based-pricing-simulation) iFlow uses the RFC Adapter. Therefore, the Cloud Connector setup for Cloud to On-Premise connections must also enable access to RFC function modules. Add a system mapping for the RFC protocol and include the following function modules as resources:

* `PIQ_CALCULATE`
* `BAPI_TRANSACTION_COMMIT`
* `BAPI_TRANSACTION_ROLLBACK`

{% hint style="info" %}
Validate the setup by testing the connection using Cloud Connector and BTP capabilities.
{% endhint %}

## SAP S/4HANA

Ensure that the following Gateway services are enabled. For the full sales API overview, see [APIs for Sales](https://help.sap.com/docs/SAP_S4HANA_ON-PREMISE/19d48293097f4a2589433856b034dfa5/f67705a25e2b440f90a25faaffa5ffef.html) on SAP Help Portal.

| Service Name                                                                                                | Comment                                                |
| ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
| [`API_SALES_ORDER_SIMULATION_SRV`](https://api.sap.com/api/OP_API_SALES_ORDER_SIMULATION_SRV_0001/overview) | Order Simulation (A2X) on SAP Business Accelerator Hub |
| [`API_SALES_ORDER_SRV`](https://api.sap.com/api/OP_API_SALES_ORDER_SRV_0001/overview)                       | Sales Order (A2X) on SAP Business Accelerator Hub      |
| [`API_SALES_QUOTATION_SRV`](https://api.sap.com/api/OP_API_SALES_QUOTATION_SRV_0001/overview)               | Sales Quotation (A2X) on SAP Business Accelerator Hub  |

## SAP Business Technology Platform

Create destinations for accessing Gateway services and RFC function modules of the desired S/4HANA tenant and client. Mind the destination names, they are referenced by the iFlow setup. The setup is summarized below:

| Name          | Comment                                                                                                                                                                                                                                                                                                                                                        |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `RFCServices` | Choose destination type **RFC**, proxy type **OnPremise**. Set up authentication according to your needs. For Target System Configuration, choose **direct connection**. Select server host, system number, and client as needed. For Communication Behavior Configuration, select table **parameter delta management** and Serialization Format **rowBased**. |
| `GW-Services` | Choose destination type **HTTP**, proxy type **OnPremise**. Configure URL and port as required. Set up authentication according to your needs.                                                                                                                                                                                                                 |

## SAP Integration Suite

For platform documentation, see [SAP Cloud Integration](https://help.sap.com/docs/cloud-integration/sap-cloud-integration/sap-cloud-integration) on SAP Help Portal.

### Integration Package

The provided Integration Package combines the relevant artifacts and documentation into a single item.

<figure><img src="/files/vQt00B1ksGN4Lbk0daEI" alt="Emporix SAP S/4HANA Integration package overview in SAP Integration Suite"><figcaption><p>Emporix SAP S/4HANA Integration package overview in SAP Integration Suite</p></figcaption></figure>

You can see the artifacts in the integration package **Artifacts** view. Artifacts are first configured on the **Design** view, you can access them after choosing the configuration of the integration flow.

<figure><img src="/files/TOVEWB0GPnEd521uIYjB" alt="Integration Package Artifacts view listing integration flows and value mappings"><figcaption><p>Integration Package Artifacts view listing integration flows and value mappings</p></figcaption></figure>

You can access the configuration details and process documentation in the integration package **Documents** view. This content is provided to help you set up the right configuration for the integration.

<figure><img src="/files/NvLm6OqalGM6Bm5PhEo2" alt="Integration Package Documents view with Configuration Guide and Process Description"><figcaption><p>Integration Package Documents view with Configuration Guide and Process Description</p></figcaption></figure>

### Credentials

To set up the credentials used by the OData adapter, open the **Manage Security** tile in Integration Suite and create credentials as needed for the OData Adapter. The preferred name is `S4HANACredentials`, which reflects the credential name configured in the provided integration package. If you use a different name, adjust the credentials in the OData adapter of the related iFlows.

The HTTP adapter setup for accessing Emporix Commerce Engine requires credentials named `emporix`. Use the [Emporix API keys](/ce/getting-started/developer-portal/manage-apikeys.md) from your tenant to configure them. If you use a different credential name, adjust the related HTTP adapter setup in the corresponding iFlows.

### A2X-based Order Simulation

This iFlow is typically called from Emporix Commerce Engine when a customer reviews the shopping cart to display current prices. It connects to SAP S/4HANA through an OData adapter. The adapter endpoint is configured in the iFlow using externalized properties.

#### iFlow configuration options

| Name                     | Description                                                                                         | Suggested default |
| ------------------------ | --------------------------------------------------------------------------------------------------- | ----------------- |
| `cartItemIds`            | Exchange property used as temporary storage for enriching response data                             |                   |
| `HdrTaxConditionType`    | Header Tax Condition Type used by header pricing to extract header tax rate                         | `TTX1`            |
| `ItmTaxConditionType`    | Item Tax Condition Type to retrieve item tax rate                                                   | `TTX1`            |
| `ItmPriceConditionType`  | Item Price Condition Type to retrieve prices                                                        | `PPR0`            |
| `SalesOrderType`         | Sales Order Type required by the Sales Order Simulation API                                         | `OR`              |
| `PartnerFunction`        | Key used for sending the Ship-To Party Business Partner as item partner                             | `SH`              |
| `SalesOrderItemCategory` | Key used for sending the order item data                                                            | `TAN`             |
| `enableResponseLogging`  | Possible values `YES`/`NO`. Enables payload logging of JSON before sending the response to Emporix. | `NO`              |
| `enableLogging`          | Possible values `YES`/`NO`. Enables payload logging before calling the Order Simulation API.        | `NO`              |

### RFC-based Pricing Simulation

This iFlow is called from Emporix Commerce Engine when a current price is required, for example at shopping cart item level. It uses base unit mapping as defined in the mapping service below and connects to SAP S/4HANA through an RFC adapter configured in the iFlow using externalized properties and the `RFCServices` destination.

#### iFlow configuration options

| Name                                                                                | Description                                                                                            | Suggested default |
| ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ----------------- |
| `OrganizationalDivision`, `DistributionChannel`, `SalesOrganization`, `cartItemIds` | Exchange properties used as temporary storage for enriching RFC function module response data          |                   |
| `ItmTaxConditionScale`                                                              | Used to scale the tax rate delivered by the RFC function module to a percentage value                  | `10`              |
| `ItmTaxConditionType`                                                               | Condition type in the RFC function module response reporting tax                                       | `TTX1`            |
| `Language`                                                                          | Language input for the RFC function module                                                             | `EN`              |
| `SalesOrderType`                                                                    | Sales Order Type required by the RFC function module                                                   | `OR`              |
| `enableResponseLogging`                                                             | Possible values `YES`/`NO`. Enables payload logging of JSON before sending the response to Emporix.    | `NO`              |
| `enableLogging`                                                                     | Possible values `YES`/`NO`. Enables payload logging before calling the RFC function module.            | `NO`              |
| `enableExtraLogging`                                                                | Possible values `YES`/`NO`. Enables logging of the RFC response after mapping to the target structure. | `NO`              |

### A2X-based Order Create

This iFlow is triggered by the `order.create` webhook. Retrieve the order create iFlow URL from the Integration Suite Management Dashboard. It connects to SAP S/4HANA through an OData adapter. The adapter endpoint is configured in the iFlow using externalized properties.

#### iFlow configuration options

| Name                   | Description                                                                                                                   | Suggested default |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------- |
| `HeaderTextLanguage`   | Sales document language                                                                                                       | `EN`              |
| `HeaderTextID`         | Text type carrying the Emporix customer creating the cart / sales order                                                       | `TX01`            |
| `SalesOrderType`       | SAP order type for the eCommerce channel                                                                                      | `OR`              |
| `PriceConditionType`   | Condition type carrying the unit price from Emporix                                                                           | `PPR0`            |
| `PartnerFunction`      | Partner function of the SAP Business Partner ID transferred in the partner segment. Any SAP partner function key is possible. | `SH`              |
| `CustomerPaymentTerms` | SAP payment terms key. Suggested: immediate payment without deduction                                                         | `0001`            |
| `ShippingCondition`    | SAP shipping condition key. Suggested: customer collection                                                                    | `03`              |
| `enableLogging`        | Possible values `YES`/`NO`. Enables payload logging as attachment by source value.                                            | `NO`              |

### A2X-based Order Status Update

This iFlow polls SAP S/4HANA orders based on timestamps and updates order status in Emporix Commerce Engine An event-based trigger is advantageous and should be considered for project-specific implementations. The timestamp-based polling is an example setup described in this guide. It connects to SAP S/4HANA through OData and HTTP adapters configured in the iFlow using externalized properties. See [Credentials](#credentials) for the `emporix` credential setup used by the receiver HTTP adapter. To set up other credentials, navigate to **Monitor** → **Integrations and APIs** → **Manage Security** → **Security Material** tile.

#### iFlow configuration options

| Name                | Description                                                                                           | Suggested default     |
| ------------------- | ----------------------------------------------------------------------------------------------------- | --------------------- |
| `createdByUser`     | Query criteria for retrieving sales orders from the API                                               | `BPINST`              |
| `queryLastRunTime`  | Datestamp to manage delta polling                                                                     | `YYYY-MM-DDT00:00:00` |
| `enableLogging`     | Possible values `YES`/`NO`. Enables logging of the payload before sending to Emporix Commerce Engine. | `NO`                  |
| `SourceBodyLogging` | Possible values `YES`/`NO`. Enables logging of the query result                                       |                       |

### A2X-based Quote Create

This iFlow is triggered by the `quote.create` webhook. It connects to SAP S/4HANA through OData and HTTP adapters; in the **Configure** menu, select each adapter to specify the endpoint using externalized properties.

This iFlow works without exchange property-based configuration options. Properties involved in mapping can be reviewed in the Groovy scripts.

### A2X-based Quote Replication

This iFlow uses scheduler-based retrieval of created or changed quotations from SAP S/4HANA. An event-based trigger is advantageous and should be considered for project-specific implementations. The timestamp is an example setup described in this guide. It supports [quote creation](/ce/management-dashboard/quotes/quotes-view.md) in Emporix Commerce Engine when the quotation originates in SAP S/4HANA, and status updates for quote approval in SAP S/4HANA. Filters are implemented to avoid creating duplicate quotes in Emporix Commerce Engine. It connects to SAP S/4HANA through OData and HTTP adapters; in the **Configure** menu, select each adapter to specify the endpoint using externalized properties. See [Credentials](#credentials) for the `emporix` credential setup used by the HTTP adapter.

#### iFlow configuration options

| Name                  | Description                                                                                           | Suggested default     |
| --------------------- | ----------------------------------------------------------------------------------------------------- | --------------------- |
| `createdByUser`       | Query criteria for retrieving sales quotations from the API                                           | `BPINST`              |
| `SalesQuotationType`  | Query criteria for retrieving sales quotations from the API                                           | `QT`                  |
| `DfltShippingCost`    | Data for defaulting the shipping data segment                                                         | `0.00`                |
| `DfltShippingZone`    | Data for defaulting the shipping data segment                                                         | `DHL`                 |
| `DfltShippingMethod`  | Data for defaulting the shipping data segment                                                         | `DHL`                 |
| `ItmTaxConditionType` | Used for determining the tax rate in the Emporix Commerce Engine payload                              | `TTX1`                |
| `ItmConditionType`    | Used for determining the unit price in the Emporix Commerce Engine payload                            | `PPR0`                |
| `queryLastRunTime`    | Datestamp to manage delta polling                                                                     | `YYYY-MM-DDT00:00:00` |
| `enableLogging`       | Possible values `YES`/`NO`. Enables logging of the payload before sending to Emporix Commerce Engine. | `NO`                  |
| `ExceptionLogging`    | Possible values `YES`/`NO`. Enables exception logging                                                 | `YES`                 |
| `BodyLogging`         | Possible values `YES`/`NO`. Enables logging of the payload for quotes identified by the S/4HANA query | `NO`                  |

#### Scheduler settings

Configure the scheduler according to your polling interval requirements.

### A2X-based Quote Status Update

This iFlow is triggered by the `quote.change` webhook. It connects to SAP S/4HANA through OData and HTTP adapters. In the **Configure** menu, select each adapter to specify the endpoint using externalized properties.

#### iFlow configuration options

| Name               | Description                                            | Suggested default |
| ------------------ | ------------------------------------------------------ | ----------------- |
| `ExceptionLogging` | Possible values `YES`/`NO`. Enables exception logging. | `YES`             |

{% hint style="info" %}
For the related process flows, see [Process Flow](/ce/extensibility-and-integrations/integrations/sap-integration/sap-sales-quotes-integration/sap-sales-quotes-process.md).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.emporix.io/ce/extensibility-and-integrations/integrations/sap-integration/sap-sales-quotes-integration/sap-sales-quotes-configuration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
