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

date comparsion

Former Member
0 Likes
476

Hi,

i have a date field in an internal table. i need to fetch record with most recent date. is there any function module to do that or is there any date comparision operator.

your help would be appreciated.

Thanks,

kranthi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
412

Hi Kranthi,

You can sort the internal table by date field. and get the first record's date. That will fetch you the recent date.

Hope it will solve your problem.

Suvan.

3 REPLIES 3
Read only

Former Member
0 Likes
413

Hi Kranthi,

You can sort the internal table by date field. and get the first record's date. That will fetch you the recent date.

Hope it will solve your problem.

Suvan.

Read only

0 Likes
412

Hi Kranthi / Sankar,

Sorting the internal table by the data field and fetching the first record seems to be the best approach.

Regards,

Anand Mandalika.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
412

Hi,

Try this.

You can use >,<,etc.,

loop at itab into wa.

if sy-tabix = 1 or v < wa-date.

v = wa-date.

endif.

endloop.

write 'Recent', v.