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

compare two dates

Former Member
0 Likes
1,004

hi gurus,

i have an internal table with 10 records.

one of the columns is 'Modification Date' ,

i need to get the latest of the records, ie. the date which is most recent.

how do i acomplish this task,

is there a function module to compare dates in an internal table.

thanks.

1 ACCEPTED SOLUTION
Read only

former_member156446
Active Contributor
0 Likes
650

you can use sort based on date and as well as compare as well

sort table itab1 by dat1 descending.

sort table itab2 by dat2 descending.

if itab1-dat1 > itab2-dat2.

....

..

4 REPLIES 4
Read only

former_member156446
Active Contributor
0 Likes
651

you can use sort based on date and as well as compare as well

sort table itab1 by dat1 descending.

sort table itab2 by dat2 descending.

if itab1-dat1 > itab2-dat2.

....

..

Read only

0 Likes
650

Sort the internal table by date descending and pick the first record.

Read only

Former Member
0 Likes
650

Hello Sanjana-

To get the latest record comparing date field for ex:budat.

sort i_tab by budat ascending.

read table i_tab into w_area index 1.

Cheers,

~Srini.....

Read only

Former Member
0 Likes
650

Hello Sanjana-

To get the latest record comparing date field for ex:budat.

sort i_tab by budat ascending.

read table i_tab into w_area index 1.

Cheers,

~Srini.....