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

finding the latest date between the two given dates

Former Member
0 Likes
996

hi,

iam having the two dates,i have to find the latest of the two dates.how can i go through it.

it is very urgent.

thanks in advance

hi,

iam having the two dates,i have to find the latest of the two dates.how can i go through it.

it is very urgent.

thanks in advance

4 REPLIES 4
Read only

Former Member
0 Likes
870

Hi Surya,

if first_date > secound_date.

write : 'first_date is greater'.

else.

write : 'second_date is greater'.

endif.

REward if useful

Read only

gopal_jee
Product and Topic Expert
Product and Topic Expert
0 Likes
870

Hi Surya,

If you have two dates then you can simply compare two dates by using relational operator like GT, LT etc and you can find out the latest date.

Kindly reward points if it is useful.

Regards,

Gopal.

Read only

Former Member
0 Likes
870

just check surya..

data: x type i ..

x = d2 - d1.

if x > 0.

write: 'first date is bigger'.

elseif x < 0.

write ' second date is bigger'.

else.

write: ' both are equal'.

endif.

rewards points if usef ull

Read only

Former Member
0 Likes
870

Hi,

DATA:dat1 TYPE sy-datum,

dat2 TYPE sy-datum.

DAT1 = SY-DATUM.

DAT2 = DAT1 - 10.

IF dat2 > dat1.

write:/ 'DAT2 is earlier'.

else.

WRITE:/ 'DAT1 is earlier'.

ENDIF.

rgds,

bharat.