# Adding process specific Due dates to the SAP Connector for AppOne

> :::note
The information in this guide applies to the **SAP Purchase-to-Pay Connector for AppOne** and **SAP Order-to-Cash Connector for AppOne**.
:::

:::note
The information in this guide applies to the **SAP Purchase-to-Pay Connector for AppOne** and **SAP Order-to-Cash Connector for AppOne**.
:::

## Introduction

Additional custom **Due dates** can be defined in the **SAP Connector**. A due date checks the difference between the **Actual date** of the event and the **Expected date** of the event. To create a proper due date, you must define both the **Actual date** and the **Expected date** for the due date. Optionally you can specify a **Due date amount** and/or a **Time bin**.

### Actual date

The **actual date** is the event end of the activity related to the due date. You must create a record expression which looks for the event end of the activity related to the due date.

### Expected Date

If the **expected date** of a due date per activity is not known, you can calculate it based on other fields. You must create a record expression that determines a certain date of an activity, for example Approve invoice) and calculate the expected date, for example by adding a number of days to the approve invoice date.

### Due date amount

The **due date amount** is often referring to a penalty or a discount. Optionally, you can create an expression to specify a due date amount in the `Due_dates_preprocessing` table.

### Time bin

The **time bin** is a description indicating whether the due date was met on time or not.

Optionally, you can create an expression to specify a time bin in the `Due_dates_preprocessing` table.

## Adding a Due date

Follow these steps to add a due date.

| Step | Action |
| --- | --- |
| 1 | Go to your **Workspace** and edit the `Duedates.csv` file. |
| 2 | Add the due date to the file. |
| 3 | In the **SAP Connector**, reload the `Due_dates_input` table in the **Process Mining input** folder. |
| 4 | Create an expression that defines the **actual date** for due date in **Due dates** folder in the `Events_preprocessing` table.  See illustration below. |
| 5 | Create an expression that calculates the **expected date** for due date in **Due dates** folder in the `Events_preprocessing` table. |
| 6 | Optionally, create an expression for the **due date amount** and/or for the **time bin** in the `Due_date_preprocessing` table. |
| 7 | Add the new due date to the case statement of the `Expected date` expression in the `Due_dates_preprocessing` table, and make sure it uses the expressions created in step 4 and 5 . See illustrations below for an example. |

![docs image](https://dev-assets.cms.uipath.com/assets/images/process-mining/process-mining-docs-image-53347-b3ab30e8-80d07b03.webp)

![docs image](https://dev-assets.cms.uipath.com/assets/images/process-mining/process-mining-docs-image-53648-35cf91f1-9f4ff840.webp)
