‎2008 Mar 12 4:47 AM
Hi
I want to get the future date by giving no of days and date in import parameters. There is one Function Module DATE_IN_FUTURE but it simply added the days to the given date and giving the date but I don't want to consider the holidays to add. Any one can help me regarding this?
Thanks in advance
Regards
GVRao
‎2008 Mar 12 4:53 AM
‎2008 Mar 12 4:51 AM
check these FM's :-
FIMA_DAYS_AND_MONTHS_AND_YEARS
HR_SGPBS_YRS_MTHS_DAYS
RKE_SELECT_FACTDAYS_FOR_PERIOD
You can use the following FM
CALL FUNCTION 'RKE_SELECT_FACTDAYS_FOR_PERIOD'
EXPORTING
i_datab = date1
i_datbi = date2
i_factid = 'GB'
TABLES
eth_dats = l_it_dat.Regards,
Santosh
‎2008 Mar 12 4:53 AM
‎2008 Mar 12 4:57 AM
Use HOLIDAY_GET function module to calculate the number of holidays between ur date and no. of days(date).
Now, to the date add no. of days as well as no.of holidays.....
‎2008 Mar 12 4:57 AM
Hi,
Try
use FM RP_CALC_DATE_IN_INTERVAL
codecall function 'RP_CALC_DATE_IN_INTERVAL'
exporting
date = '06/15/2006'
days = 14
months = 0
signum = '+'
years = 0
importing
calc_date = wa_date.
‎2008 Mar 12 5:10 AM
Use Function Module to get the Future date:
RP_CALC_DATE_IN_INTERVAL
Validate the date across the Function Module:
HOLIDAY_CHECK_AND_GET_INFO Useful for determining whether or not a date is a holiday. Give the function a date, and a holiday calendar, and you can determine if the date is a holiday by checking the parameter HOLIDAY_FOUND.
Example: HOLIDAY_CHECK_AND_GET_INFO
data: ld_date like scal-datum default sy-datum,
lc_holiday_cal_id like scal-hcalid default 'CA',
ltab_holiday_attributes like thol occurs 0 with header line,
lc_holiday_found like scal-indicator.
CALL FUNCTION 'HOLIDAY_CHECK_AND_GET_INFO'
EXPORTING
date = ld_date
holiday_calendar_id = lc_holiday_cal_id
WITH_HOLIDAY_ATTRIBUTES = 'X'
IMPORTING
HOLIDAY_FOUND = lc_holiday_found
tables
holiday_attributes = ltab_holiday_attributes
EXCEPTIONS
CALENDAR_BUFFER_NOT_LOADABLE = 1
DATE_AFTER_RANGE = 2
DATE_BEFORE_RANGE = 3
DATE_INVALID = 4
HOLIDAY_CALENDAR_ID_MISSING = 5
HOLIDAY_CALENDAR_NOT_FOUND = 6
OTHERS = 7.
if sy-subrc = 0 and
lc_holiday_found = 'X'.
write: / ld_date, 'is a holiday'.
else.
write: / ld_date, 'is not a holiday, or there was an error calling the function'.
endif.
Hope this Helps.
Regards
Vinayak