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

About date comparision

Former Member
0 Likes
1,106

Hi Experts,

Actually i want to compare two dates which are in DD/MM/YYYY.

I want to get recent date.

Pls help me.

Thanks,

Madhu.

Hi Experts,

Actually i want to compare two dates which are in DD/MM/YYYY.

I want to get recent date.

Pls help me.

Thanks,

Madhu.

8 REPLIES 8
Read only

Former Member
0 Likes
1,069

Hi Madhu,

Kindly go through this link below:

https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/functionModulerelatedonDate+calculations

Hope it helps

Regrds

Mansi

Read only

Former Member
0 Likes
1,069

Just convert date into internal format by using CONVERT_DATE_TO_INTERNAL

and then compare.

Read only

Former Member
0 Likes
1,069

hi,

Use this FM for DATE comparision



HR_HK_DIFF_BT_2_DATES  

"or


FIMA_DAYS_AND_MONTHS_AND_YEARS  

Thanks

Arun

Edited by: Arun Kayal on Feb 20, 2009 7:53 AM

Read only

Former Member
0 Likes
1,069

hi,

move the date to an integer variable

if the integer is greater then that is your recent date

data:
w_integer1 type i,
w_integer2 type i,
w_date1 type sy-datum,
w_date2 type sy-datum value '12122009'.
w_date1 = sy-datum.
w_integer1 = w_date1.
w_integer2 = w_date2.

if w_integer1 > w_integer2.
write:/ w_date1.
else.
write:/ w_date2.
endif.

thanks

sarves

Read only

Former Member
0 Likes
1,069

Hi Madhu..Kindly chk this..


parameters:
p_date1 type d,
p_date2 type d.

write:/ 'Recent date'.
if p_date1 gt p_date2.
write:/ p_date1.
else.
write:/ p_date2.
endif.

Regards,

Mdi.Deeba

Read only

former_member222860
Active Contributor
0 Likes
1,069

hi,

Check this FM

FIMA_DATE_COMPARE

Read only

Former Member
0 Likes
1,068

Hi Madhu,

You just want to get latest date from given two date ...........if so then you have to compare the date above give FM

or you can do one thing you just check

Date 1 > Date2 or Date1< Date 2

-Rick

Edited by: Ricky Maheshwari on Feb 20, 2009 12:27 PM

Read only

Former Member
0 Likes
1,068

Hi,

Check the below Link

Hope this helps you.

Regards,

Anki Reddy