# RP_CALC_DATE_IN_INTERVAL — Add or Subtract Years, Months and Days to a Date

> Calculates a date in the future or past by adding or subtracting a number of years, months and days to a start date. It is used in reports and HR or contract logic to compute due dates, validity ends or probation periods. Set SIGNUM to '+' or '-' and pass all three counters (use 0 for unused ones); month ends are adjusted automatically.

- Modules: CA
- Type: Function module
- Function group: RPPA
- Remote-enabled (RFC): No
- S/4HANA status: Used the same way in S/4HANA
- URL: https://nekuhub.com/en/functions/rp-calc-date-in-interval/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| DATE | P0001-BEGDA | Start date | Yes |
| DAYS | T5A4A-DLYDY | Number of days | Yes |
| MONTHS | T5A4A-DLYMO | Number of months | Yes |
| SIGNUM | T5A4A-SPLIT | Direction ('+' or '-') | - |
| YEARS | T5A4A-DLYYR | Number of years | Yes |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| CALC_DATE | P0001-BEGDA | Calculated date |

## Call template (ABAP)

```abap
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
  EXPORTING
    date = lv_date
    days = lv_days
    months = lv_months
    years = lv_years
  IMPORTING
    calc_date = lv_calc_date.
```


