cancel
Showing results for 
Search instead for 
Did you mean: 

Subtract Business Days from a Date

carmine1
Explorer
0 Kudos
294

In Crystal Reports, how to subtract a number of business days (Monday through Friday) from an input date?

For example, October 29, 2024 - 16 business days = October 7, 2024

View Entire Topic
Ranjan__Panda
Explorer

Hi,

Use this function module to subtract a number of business days (Monday through Friday) from an input date.

DATA: lv_date TYPE sy-datum.  "Input Date
DATA: lv_business_days TYPE i VALUE 10. "Number of business days to subtract
DATA: lv_new_date TYPE sy-datum. "Output Date

CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = lv_date     "October 29, 2024
days = lv_business_days    "16 business days
months = 0
years = 0
signum = '-'
IMPORTING
calc_date = lv_new_date.  "October 7, 2024

WRITE: / lv_date, lv_new_date.

 

Regards,
Ranjan Panda

carmine1
Explorer
0 Kudos
Thanks! I will give this a try.