06-01-2006 5:59 PM
Hi everybody!
I need a function or code to find if a year is leap year or normal year.
Thanks a lot of!
DM
06-01-2006 6:02 PM
I don't know of one - but it is quite an easy calculation so you could maybe write your own.
A year will be a leap year if it is divisible by 4 but not by 100. If a year is divisible by 4 and by 100, it is not a leap year unless it is also divisible by 400.
Message was edited by: Barbara McCallum
06-01-2006 6:04 PM
Hi
Please check the below FM, to get days between 2 dates.
You can use the logic behind to build Z FM if this is not as per your requirement.
FIMA_LEAP_DAYS_BETWEEN_2_DATES
LEAP_DAYS_BETWEEN_TWO_DATES
Regds
Manohar
06-01-2006 6:08 PM
06-01-2006 6:11 PM
Here is some code that I had in my bag of tricks.
report zrich_0001 .
parameters: p_datum type sy-datum.
* check if it is a leap year.
data: march1 type sy-datum.
data: last_day_feb type sy-datum.
march1 = p_datum.
march1+4(4) = '0301'.
last_day_feb = march1 - 1.
if last_day_feb+6(2) = '29'.
write:/ 'This is a leap year'.
endif.
Regards,
Rich Heilman