> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sync.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SAP Gateway

You can use the SAP Gateway connector from the CData Sync application to capture data
from SAP Gateway and move it to any supported destination. To do so, you need to add
the connector, authenticate to the connector, and complete your connection.

## Add the SAP Gateway Connector

To enable Sync to use data from SAP Gateway, you first must add the
connector, as follows:

<ol>
  <li>Open the **Connections** page of the Sync dashboard.</li>
  <li>Click **Add Connection** to open the **Select Connectors** page.</li>
  <li>Click the **Sources** tab and locate
  the **SAP Gateway** row.</li>

  <li>
    Click the **Configure Connection** icon at the end of that row to open
    the **New Connection** page. This action opens the
    **Add Connection** dialog.

    **Note:** If the **Configure Connection** icon is not
    available, click the **Download Connector** icon to install
    the SAP Gateway connector.
  </li>

  <li>Enter a name for your connection in the **Add Connection** dialog.</li>
  <li>Click **Add** to open the **Settings** tab for your connector.</li>
</ol>

For more information about installing new connectors, see
[Connections](https://docs.sync.cdata.com/26.4/en/connections/connections.md).

## Authenticate to SAP Gateway

After you add the connector, you need to set the required properties.

**URL:** Enter the URL either for your environment (for example, [https://sapes5.sapdevcenter.com/](https://sapes5.sapdevcenter.com/)) or to the full URL of the service. For example, your environment URL might be simliar to [https://sapes5.sapdevcenter.com](https://sapes5.sapdevcenter.com), and the full URL to your service might be similar to [https://sapes5.sapdevcenter.com/sap/opu/odata/IWBEP/GWSAMPLE\_BASIC/](https://sapes5.sapdevcenter.com/sap/opu/odata/IWBEP/GWSAMPLE_BASIC/).

CData Sync supports authenticating to SAP Gateway in several ways. Select your authentication method below to proceed to the relevant section that contains the authentication details.

* [**OAuth**](#oauth) (default)
* [**Basic**](#basic)
* [**Token**](#token)
* [**OAuth PKCE**](#oauth-pkce)
* [**SAS BTP Destination Service**](#sap-btp-destination-service)

### OAuth

To connect with OAuth custom credentials, specify the following properties:

<ul><li>**Auth Scheme:** Select **OAuth**.</li>
<li>**OAuth Client Id:** Enter the client Id that you were assigned when you registered your application with an OAuth authorization server.</li>
<li>**OAuth Client Secret:** Enter the client secret that you were assigned when you registered your application with an OAuth authorization server.</li></ul>

* **Scope:** Enter space-separated values for the permission scopes. These scopes are required when you authenticate via an OAuth2.0 flow.

### Basic

To connect with your user credentials, set the following properties:

<ul><li>**Auth Scheme:** Select **Basic**.</li>
<li>**User:** Enter the username that you use to authenticate to your SAP Gateway account.</li>
<li>**Password:** Enter the password that you use to authenticate to your SAP Gateway account.</li></ul>

### Token

To connect with an access token, specify the following properties:

* **Auth Scheme:** Select **Token**.
* **API Key:** Enter the API key of the application that you created.

### OAuth PKCE

To connect with the OAuth PKCE extension, specify the following properties:

* **Auth Scheme:** Select **OAuthPKCE**.
* **OAuth Client Id:** Enter the client Id that you were assigned when you registered your application with an OAuth authorization server.

### SAP BTP Destination Service

To connect via the SAP BTP Destination Service, select **SAPBTP** for **Auth Scheme**. No additional properties are required.

## Complete Your Connection

To complete your connection:

1. Specify the following properties:
   * (Optional) **Namespace:** Enter the service namespace from which you want to retrieve data.

     > [!NOTE]
     >
     > You must specify the namespace if the service is not specified in the URL.

   * (Optional) **Service:** Enter one or more services (separated by commas) from which you want to retrieve data.

     > [!NOTE]
     >
     > If the service or services is set in the URL, this property is ignored. If the services are not set either in the URL or via this property, the SAP Gateway catalog service is used to discover all the available services.

   * **Custom Url Params:** Enter any additional required properties that you need to include with the HTTP request (for example, **sap-client=001\&sap-language=EN**).
2. Define advanced connection settings on the **Advanced** tab. (In most cases, though, you should not need these settings.)
3. If you authenticate with OAuth or OAuthPKCE, click **Connect to SAP Gateway** to connect to your SAP Gateway account.
4. Click **Create & Test** to create your connection.

## Enable Change Data Capture for SAP Gateway

CData Sync supports change data capture (CDC) for SAP Gateway sources by using OData V4 delta tokens. On each incremental run, Sync requests only the records that changed since the previous run rather than replicating the full table.

> [!NOTE]
>
> CDC is supported for OData V4 services only. SAP Gateway OData V2 services are not supported for CDC.

### Prerequisites

Before you configure a CDC job for SAP Gateway, verify the following prerequisites:

* **Driver version:** The CData SAP Gateway driver version must be 26.0.9750 or later. If your connection uses an earlier version, the CDC option is not available when you create a job.
* **OData V4 service:** Your SAP Gateway service must expose an OData V4 endpoint.
* **Data format:** The SAP Gateway service must deliver responses in JSON. Delta requests in XML format return an HTTP 406 error.

### Configure SAP Gateway for CDC in CData Sync

Before you [create a CDC job](https://docs.sync.cdata.com/26.4/en/jobs/change-data-capture.md#creating-a-cdc-job-in-cdata-sync), update the following property for your SAP Gateway connection:

1. Open the **Advanced** tab of the SAP Gateway source page and navigate to the **Miscellaneous** category.
2. Select **JSON** as the value for **Data Format**.
3. Click **Create & Test** to save your connection.

For standard CDC jobs in Sync, change tracking is enabled automatically at job execution time.

### Creating a CDC Job for SAP Gateway

To configure a CDC job for your SAP Gateway source, create a CDC job in Sync using SAP Gateway as the source, as explained in [Creating a CDC Job in CData Sync](https://docs.sync.cdata.com/26.4/en/jobs/change-data-capture.md#creating-a-cdc-job-in-cdata-sync).

When you add tables to the job, the task list shows only entity sets that have the `ChangeTracking` capability declared in their SAP metadata.

## More Information

For more information about interactions between CData Sync and SAP Gateway, see
[SAP Gateway Connector for CData Sync](https://cdn.cdata.com/help/GCN/synch/default.htm).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.