COMPARE TWO DATES WITH THE BUSINESS DAYS
Hello everyone,
I have a sitiuation. We define something as a late order if the difference between the order date and ship date is greater than two BUSINESS days.
How do I determine the number of business days between the order date and ship date. Any help will be appreciated.
You can use the FM 'DATE_CONVERT_TO_FACTORYDATE'.
l_2_biz_days_from_today = sy-datum.
do 2 times.
add 1 to l_2_biz_days_from_today.
call function 'DATE_CONVERT_TO_FACTORYDATE'
exporting
* CORRECT_OPTION = '+'
date = l_2_biz_days_from_today
factory_calendar_id = 'YOUR_CALENDAR_ID'
importing
date = l_2_biz_days_from_today
* FACTORYDATE =
* WORKINGDAY_INDICATOR =
exceptions
calendar_buffer_not_loadable = 1
correct_option_invalid = 2
date_after_range = 3
date_before_range = 4
date_invalid = 5
factory_calendar_not_found = 6
others = 7.
if sy-subrc <> 0.
"Ignore and Continue
endif.
enddo.
_________________
Sudhi Karkada
hi
CALL FUNCTION 'FIMA_DAYS_BETWEEN_TWO_DATES'
you can use this function for comparing the dates you will Get count of Days if you have any problem with its parameters get back.
Prasad.
thank you sudhi for a good suggestion