Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Find date

Former Member
0 Likes
682

Hi All,

I have a date field date1.

I want to check whether it falls between date2 and date3.

Date2 - Start date

Date3 - End date

Let me know how to do it.

Regards,

SP

6 REPLIES 6
Read only

Former Member
0 Likes
639

Hi Sandeep,

you can directly check that date by comparing with those two dates.

i.e. if dat1 ge dat2 and dat2 le dat3.

< do the process needed>

endif.

<b>Reward points if this solves your problem.</b>

Kiran

Read only

Former Member
0 Likes
639

data:

w_date1 type sy-datum,

w_date2 type sy-datum,

w_date3 type sy-datum.

w_date1 = '20080101'.

w_date2 = '20050101'.

w_date3 = sy-datum.

if w_date3 lt w_date1 and w_date3 gt w_date2.

write 'Lies in interval'.

else.

write 'Doesnot lie in the interval'.

endif.

Here is the code.

Regards,

Pavan P.

Read only

Former Member
0 Likes
639

Hi sandeep,

a -


>1st date,

b -


>2nd date,

c -


>3rd date,

if a >b and a<c

write: a.

I fuseful reward points.

Read only

0 Likes
639

endif.

after IF condition.

Thanks

Sanket

Read only

Former Member
0 Likes
639

Hello,

Try this function module and reward if found help full.

GM_VALIDATE_DATE_RANGE

Regards,

rakesh.

Read only

Former Member
0 Likes
639
DATA  : date1 like  syst-datum,
            date2 like  syst-datum ,
            date3 like  syst-datum .


IF  date1 <  date2. 
  WRITE: /  " date  is  lesser '. 
ELSEIF  date1 >  date2 AND 
        date1 <  date3. 
  WRITE: /  'date is present in between '
ELSE. 
  WRITE /  'date is   greater '.
ENDIF.

reward points if it is usefull ..

Girish