Check dedicated post to Add days/month/year to date.
Manipulate dates in worked days (or factory days)
Add working days to a date
You can use Function BKK_ADD_WORKINGDAY.
Difference between 2 dates in worked days
You can use Function RKE_SELECT_FACTDAYS_FOR_PERIOD.
DATA : lt_dates_in_period TYPE STANDARD TABLE OF rke_dat,
lv_calendar_fr TYPE wfcid VALUE 'FR'.
CALL FUNCTION 'RKE_SELECT_FACTDAYS_FOR_PERIOD'
EXPORTING
i_datab = lv_date_1 " // 2023-09-01 (Friday)
i_datbi = lv_date_2 " // 2023-09-05 (Wednesday)
i_factid = lv_calendar_fr
TABLES
eth_dats = lt_dates_in_period " // [3x1(16)] Standard Table
EXCEPTIONS
date_conversion_error = 1
OTHERS = 2.
IF sy-subrc = 0.
" lt_dates_in_period contains list of worked days dates :
" [ [ 2023-09-01 ]
" [ 2023-09-04 ]
" [ 2023-09-05 ] ]
DATA(lv_num_worked_days_in_period) = lines( lt_dates_in_period ). " // 3
ENDIF.
About the author