‎2005 Nov 22 4:33 PM
i have 2 dates from table "date1" "date2".
i want that date3 will get the biggest date between the two, and if both of them are null he will get a value
that i tell him.
‎2005 Nov 22 4:39 PM
if date1 is initial and
date2 is initial.
*-- set default value
date3 = <default value>.
elseif date1 > date2.
date3 = date1
else.
date3 = date2.
endif.
‎2005 Nov 22 4:40 PM
‎2005 Nov 22 4:42 PM
> i'm looking for function
> thanks
I don't think there is any function module to do that.
‎2005 Nov 22 4:46 PM
There is no existing FM to do this. Its a simple comparision that it does not warrant a seperate Funtion module. But if you need one, you can always create a new function module and put in Srinivas's or Vijay's code in it.
‎2005 Nov 22 4:46 PM
‎2005 Nov 22 4:46 PM
I would go on with Srinivas this is to "simple" to capture it in a function...
and the issue was "biggest date between" thats why I used -1 to get the day before...
‎2005 Nov 22 4:40 PM
Hi,
if not date1 is initial and
not date2 is initial.
if date1 gt date2
date3 = date1 - 1.
else.
date3 = date2 - 1.
endif.
else.
tell me something for date3
endif.
regards matt
‎2005 Nov 22 4:41 PM
Hi,
data: date1 type sy-datum,
date2 type sy-datum,
date3 type sy-datum.
date1 = sy-datum.
date2 = sy-datum + 1.
if date1 gt date2.
date3 = date1 .
else.
date3 = date2 .
endif.
Regards
vijay
‎2005 Nov 22 4:41 PM
‎2005 Nov 22 4:51 PM
If you are looking for a Fuction Module, try RELATION_BETWEEN_TWO_DATES