> ## 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 ERP

export const CommonDatasourceMoreInformation = ({datasource = "the data source", advancedurl = "", siteName = "CData Sync", driverVersion = ""}) => {
  return <>
      <p>
        For more information about interactions between {siteName} and {datasource}, see{' '}
        <a href={`https://cdn.cdata.com/help/${advancedurl}${driverVersion}/synch/default.htm`}>
          {datasource} Connector for {siteName}
        </a>.
      </p>
    </>;
};

export const CommonDatasourceAddConnector = ({datasource = "the data source", title = "the connector", destination = false, siteNameShort = "Sync"}) => {
  return <>
      <p>
        To enable {siteNameShort} to use data from {datasource}, you first must add the
        connector, as follows:
      </p>
      <ol>
        <li>Open the <strong>Connections</strong> page of the {siteNameShort} dashboard.</li>
        <li>Click <strong>Add Connection</strong> to open the <strong>Select Connectors</strong> page.</li>
        <li>
          Click the <strong>{destination ? "Destinations" : "Sources"}</strong> tab and locate
          the <strong>{title}</strong> row.
        </li>
        <li>
          Click the <strong>Configure Connection</strong> icon at the end of that row to open
          the <strong>New Connection</strong> page. This action opens the{' '}
          <strong>Add Connection</strong> dialog box.
          <br />
          <strong>Note:</strong> If the <strong>Configure Connection</strong> icon is not
          available, click the <strong>Download Connector</strong> icon to install
          the {title} connector.
        </li>
        <li>Enter a name for your connection in the <strong>Add Connection</strong> dialog box.</li>
        <li>Click <strong>Add</strong> to open the <strong>Settings</strong> tab for your connector.</li>
      </ol>
      <p>
        For more information about installing new connectors, see{' '}
        <a href="../connections">Connections</a>.
      </p>
    </>;
};

export const CommonDatasourceIntroSource = ({datasource = "the data source", siteName = "CData Sync"}) => {
  return <p>
      You can use the {datasource} connector from the {siteName} application to capture data
      from {datasource} and move it to any supported destination. To do so, you need to add
      the connector, authenticate to the connector, and complete your connection.
    </p>;
};

export const driverVersion = "M";

export const siteNameShort = "Sync";

export const siteName = "CData Sync";

export const datasource = "SAP ERP";
export const pageTitle = "SAP ERP";
export const advancedurl = "RY";

<CommonDatasourceIntroSource datasource={datasource} siteName={siteName} />

<Note>This connector is available in {siteNameShort} Self-Hosted deployments only.</Note>

## Prerequisites

Before you can connect to {datasource}, you must set up the following components:

1. Download the Software Developer Kit (SDK), based on your operating system, from <a href="https://support.sap.com/en/product/connectors/jco.html?anchorId=section_2129803369" target="_blank" rel="noopener noreferrer">SAP Java Connector</a>.
2. Download the sapjco3.jar and sapjco3.dll files from the SDK, as follows:
   1. Open the SAP Java connector and select the Jco version that matches your platform.
   2. Click the download link. This action opens the login page.
   3. Login to the SAP site with a valid S-user identifier (Id).
   4. Download the package.
3. Copy the sapjco3.jar file to the `/libs/ext` folder in your application directory.
4. Copy the sapjco3.dll file (or, use libsapjco3.so if your {siteNameShort} instance is on a Linux machine) to the `/libs/ext` folder in your application directory.

## Add the SAP ERP Connector

<CommonDatasourceAddConnector datasource={datasource} title={pageTitle} destination={false} siteNameShort={siteNameShort} />

## Authenticate to SAP ERP

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

* **User:** Enter the username that you use to authenticate to {datasource}.
* **Password:** Enter the password that you use to authenticate to the {datasource} account.
* **Client:** Enter the name of the client that you want to authenticate to the SAP system.
* **Connection Type:** Select the connection type that you want to use. The default type is **JCo**.
* **Connection Scheme:** Select the connection scheme that you want to use. The default scheme is **ApplicationServer**.

## Complete Your Connection

To complete your connection:

1. Specify the following properties:
   * **Host:** Enter the host name of the target system. You can specify a regular host name, an IP address, or a SAP router address.

* **System Number:** Select the number that defines the target system. The default value is **0**.

2. Define advanced connection settings on the **Advanced** tab. (In most cases, though, you should not need these settings.)
3. Click **Connect to {datasource}** to connect to your {pageTitle} account.
4. Click **Create & Test** to create your connection.

## Enabling CDC in {siteName}

To configure your SAP ERP source connection to use CDC, follow these steps:

1. Open the **Advanced** tab of the SAP ERP source page and navigate to the **Miscellaneous** category.
2. Select **ChangeDataCapture** for the **Table Mode** property.
3. Click **Create & Test** to save your connection change.
4. Create a job in {siteNameShort} using {datasource} as your source and select **Change Data Capture** for the **Type** option.

Once you create a CDC job, the **Tasks** list shows only tables that are enabled for CDC. If you have custom tables that you want to appear in the **Tasks** list for the CDC job, you must enable them for tracking first in the SAP GUI. The following section explains how to enable such tables for tracking.

## Enable SAP Custom Tables for CDC

To prepare SAP custom tables for use with CDC in {siteNameShort}, perform the steps in the following sections.

#### Step 1: Create Your Custom Table and Data Elements with the Change Document Flag

In the SAP GUI, create a custom table, as follows:

1. Open {datasource} and navigate to transaction **SE11**.

2. On the **ABAP Dictionary: Initial Screen** page, select the **Database Table** radio button and enter a name for your custom table (for example, **ZMACHINES\_TABLE**) in the associated text box.

   <Note>The initial Z in the name is required for custom objects in {datasource}.</Note>

3. Click **Create**. This action opens the **Create Table** page.

4. On the **Create Table** page, enter a short description of your table (for example, **Machines Table**).

5. Click **Technical Settings** in the menu bar at the top of the window.

6. On the **General Properties** tab of the **Dictionary: Define Technical Settings** page:
   1. Select **APPL0** in the **Data Class** list. This is the typical selection for master data and transparent application tables.

   2. Select the **Log Data Changes** checkbox and save your changes.

      <img src="https://mintcdn.com/cdata-sync/IzPXzuYOg0g8nJPd/images/SAP-ERP-Source_enabling-cdc-for-SAP-ERP_1.png?fit=max&auto=format&n=IzPXzuYOg0g8nJPd&q=85&s=c1c1f62dd5b2b83ca617f047097c5c49" width="400" alt="Dictionary Define Technical Settings page showing Log Data Changes checkbox" data-path="images/SAP-ERP-Source_enabling-cdc-for-SAP-ERP_1.png" />

   3. Click **Cancel** to return to the previous page.

7. Click the **Fields** tab and follow these steps to create any new fields that you want.
   1. Enter a field name in the **Fields** column (for example, **NEW\_FIELD**).

   2. Enter a name for the new element in the **Data Element** field. To create a custom data element, enter a name that starts with the letter Z (for example, **ZNEWDATAELEMENT**). SAP prompts you to create a new element if it does not already exist.

      <img src="https://mintcdn.com/cdata-sync/IzPXzuYOg0g8nJPd/images/SAP-ERP-Source_enabling-cdc-for-SAP-ERP_2.png?fit=max&auto=format&n=IzPXzuYOg0g8nJPd&q=85&s=9354b123ec719dc8d501219e6bbcdb66" width="600" alt="Fields tab showing data element configuration" data-path="images/SAP-ERP-Source_enabling-cdc-for-SAP-ERP_2.png" />

   3. Double-click the name that you entered. SAP will prompt you for additional configuration in other columns (**Data Type**, **Length**, and **Description**).

8. Activate the table by clicking the **Activate** icon in the menu bar.

   <img src="https://mintcdn.com/cdata-sync/IzPXzuYOg0g8nJPd/images/SAP-ERP-Source_enabling-cdc-for-SAP-ERP_3.png?fit=max&auto=format&n=IzPXzuYOg0g8nJPd&q=85&s=b3f36c21a69ce76ef055794c6253fb01" width="600" alt="Activate icon in the menu bar" data-path="images/SAP-ERP-Source_enabling-cdc-for-SAP-ERP_3.png" />

#### Step 2: Create and Configure the Change Document Object

Follow these steps to create and configure a change document object (SCDO):

1. Open transaction **SCDO**.

2. Enter a name for your object (for example, **ZMACHLOG**) in the **Object** text box.

3. Click **Create** to create a new change document object and open the **Create Object Directory Entry** dialog box.

   <img src="https://mintcdn.com/cdata-sync/IzPXzuYOg0g8nJPd/images/SAP-ERP-Source_enabling-cdc-for-SAP-ERP_4.png?fit=max&auto=format&n=IzPXzuYOg0g8nJPd&q=85&s=8d6c9e6a65aad7f209aedc7d08b5c4c2" width="450" alt="Create Object Directory Entry dialog box" data-path="images/SAP-ERP-Source_enabling-cdc-for-SAP-ERP_4.png" />

4. Select **Local Object** from the **Package** list. Provide a short description of the object (for example, "Change Document Object for Machines Tab").

5. Click the **Table** tab to assign your custom table to your change document object.
   1. Add your table name (for example, **ZMACHINES\_TABLE**).

   2. Select the **Delete Documentation** column and the **Insert Documentation** column, as shown below:

      <img src="https://mintcdn.com/cdata-sync/IzPXzuYOg0g8nJPd/images/SAP-ERP_create-and-configure-change-document-object_1.png?fit=max&auto=format&n=IzPXzuYOg0g8nJPd&q=85&s=a2e884720585d7baa3df8688c83e3ea2" width="450" alt="Table tab showing Delete Documentation and Insert Documentation columns selected" data-path="images/SAP-ERP_create-and-configure-change-document-object_1.png" />

   3. Click the **Save** icon in the task bar at the top of the window.

6. Click **Generate** in the task bar.

7. In the **Generate Update Pgm.** dialog box, enter a name in the **Function group** text box (for example, **ZMACHLOG\_WRITE\_DOCUMENT**).

8. Click **Generate** at the bottom of the dialog box.

9. On the next page, double-click the name of your function group (**ZMACHLOG\_WRITE\_DOCUMENT**). This action takes you to transaction SE37.

   <img src="https://mintcdn.com/cdata-sync/IzPXzuYOg0g8nJPd/images/SAP-ERP_create-and-configure-change-document-object_2.png?fit=max&auto=format&n=IzPXzuYOg0g8nJPd&q=85&s=a29b71550227a397f12626c48e81b781" width="450" alt="Function group name in transaction SE37" data-path="images/SAP-ERP_create-and-configure-change-document-object_2.png" />

   SAP generates a function module that is executed each time this object is involved. You might need to adapt the logic to handle the insertions, updates and deletions based on your scenario. You can modify this module, depending on your scenario.

10. Click the **Validate** icon (<img style={{verticalAlign: "middle"}} src="https://mintcdn.com/cdata-sync/IzPXzuYOg0g8nJPd/images/SAP-ERP_create-and-configure-change-document-object_3.png?fit=max&auto=format&n=IzPXzuYOg0g8nJPd&q=85&s=1976e62611a4246955c9113183a50b51" alt="Validate icon" width="20" height="24" data-path="images/SAP-ERP_create-and-configure-change-document-object_3.png" />) to check the module syntax.

11. Click the **Activate** icon (<img style={{verticalAlign: "middle"}} src="https://mintcdn.com/cdata-sync/IzPXzuYOg0g8nJPd/images/SAP-ERP_create-and-configure-change-document-object_4.png?fit=max&auto=format&n=IzPXzuYOg0g8nJPd&q=85&s=d4078104d97fec4b88703f2904df5902" alt="Activate icon" width="21" height="20" data-path="images/SAP-ERP_create-and-configure-change-document-object_4.png" />) to activate the function module.

At this point, the infrastructure for change documents in SAP is in place. However, no entries are logged until the system-generated function module (ZMACHLOG\_WRITE\_DOCUMENT) is invoked. This invocation must occur within the application logic, update module, or custom program that modifies the table, ensuring that each change is explicitly captured and recorded.

#### Step 3: Verify That Your Table Is Ready for CDC

Now, you should verify that the target table is ready for change-document capture (CDC). This ensures that the system recognizes the SCDO object that you created and that subsequent changes will be logged correctly.

1. Open transaction **SE16**.

2. Enter the table name **TCDOB**.

   <img src="https://mintcdn.com/cdata-sync/IzPXzuYOg0g8nJPd/images/SAP-ERP-Source_verify-CDC-is-enabled-for-table_1.png?fit=max&auto=format&n=IzPXzuYOg0g8nJPd&q=85&s=b4619baf772114e28f3fb6f3df26d0cb" width="400" alt="Data Browser showing TCDOB table entry" data-path="images/SAP-ERP-Source_verify-CDC-is-enabled-for-table_1.png" />

3. On the **Data Browser - Table TCDOB** page, filter by entering **ZMACHINES\_TABLE** in the **TABNAME** text box.

   Once you do this, you can see that the SCDO object you created is linked to your table and that it is ready to handle CDC.

   <img src="https://mintcdn.com/cdata-sync/IzPXzuYOg0g8nJPd/images/SAP-ERP-Source_verify-CDC-is-enabled-for-table_2.png?fit=max&auto=format&n=IzPXzuYOg0g8nJPd&q=85&s=5ba49e1c904ba9c41435fef2ba914a72" width="800" alt="Data Browser showing SCDO object linked to ZMACHINES_TABLE" data-path="images/SAP-ERP-Source_verify-CDC-is-enabled-for-table_2.png" />

## More Information

<CommonDatasourceMoreInformation datasource={datasource} advancedurl={advancedurl} siteName={siteName} driverVersion={driverVersion} />
