2007 Apr 18 4:13 PM
Hi All-
I need to know from you guy's is there any way we can know is that date is falling between two dates...
For Example: p_date = 03/10/2007
p_date1 = 03/10/2006
another date = 11/10/2006 -
So, Now this date is falling between these two dates...I want to know, how to find out that?
Please give me solution...
Thanks,
Sony
2007 Apr 18 4:19 PM
Use the code..
If p_date le p_date2 and p_date ge p_date1.
p_date is between the two dates
endif.
~Suresh
2007 Apr 18 4:20 PM
There are a few ways to do this, one of the easiest is to do something like this.
data: p_datum type sy-datum.
data: p_datum_begin type sy-datum.
data: p_datum_end type sy-datum.
if p_datum => p_datum_begin
and p_datum <= p_datum_end.
Endif.
Again, there are a few more ways to do this.
Regards,
RIch Heilman
2007 Apr 18 4:23 PM
Hi,
Please try this.
DATA: P_DATE1 LIKE SY-DATUM VALUE '20061006',
P_DATE2 LIKE SY-DATUM VALUE '20071003',
V_DATE LIKE SY-DATUM VALUE '20061011'.
CHECK V_DATE BETWEEN P_DATE1 AND P_DATE2.
WRITE: / 'INPUT DATE IS BETWEEN TWO DATES'.
Regards,
Ferry Lianto
2007 Apr 18 4:24 PM
HI Sony,
One more way.
ranges r_date for sy-datum.
r_date-sign = 'I'.
r_date-option = 'BT'.
r_date-low = p_date1.
r_date-high = p_date2.
append r_date.
clear r_date.
if another_date in r_date.
* Your date falls in that range
endif.