‎2007 Jul 24 6:56 AM
Hi Friends,
i am facing problem while validating the date field,
i want to restrict the user to maximum of one year of intervel of his given date.
Regards,
Saleem
‎2007 Jul 24 6:59 AM
use the fm to get the difference between the 2 dates in terms of number of days and check the value as 365.
reward if helpful
cheers
sharadendu
‎2007 Jul 24 7:00 AM
hi
have a try with this fm
data st2_date type sy-datum.
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
days = '0'
months = '+12'
start_date = sy-datum
IMPORTING
result_date = st2_date.
if s_date-high > st2_date.
message 'Error' type 'E'.
endif.
if helpful, reward
Sathish. R
‎2007 Jul 24 7:03 AM
call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
exporting
i_date_from = p_lv_start_date
I_KEY_DAY_FROM =
i_date_to = p_lv_date1
I_KEY_DAY_TO =
I_FLG_SEPARATE = ' '
importing
E_DAYS =
e_months = p_lv_month_diff
E_YEARS =
.
using this FM u can find the diff between dates.
‎2007 Jul 24 7:04 AM
Hi saleem,
Use FM FIMA_DAYS_AND_MONTHS_AND_YEARS .
THis will Give differnece between two dates.
IF the number of days Gretaer than 365 OR 366 then give a error message.,
I hope it will solve your problem.
Thanks,CSR.
PS:Reward if helpful.
‎2007 Jul 24 7:06 AM
hi
use this FM
CALL FUNCTION 'HR_ECM_ADD_PERIOD_TO_DATE'
EXPORTING
ORIG_DATE = 'your date'
NUM_DAYS = 0
NUM_MONTHS = 0
NUM_YEARS = 1 " add one year to it. it will automatically add one year irrespective of leap year
SIGNUM = '+' for addition
MESSAGE_HANDLER = MESSAGE_HANDLER
IMPORTING
RESULT_DATE = your_result
now check the date for futher processing
<b>reward points plz</b>
Message was edited by:
Fazeel