06-17-2009 2:17 PM
Hi Everyone,
I've an internal table which holding few records which contain date field. How I can check this internal table by getting the record which contain "latest date" only? Kindly advise. Thank you.
eg:
I should only get the record which contain lastest date. (eg: I should picked up Record3)
Table i_test
Field 1 Field 2(date)
Record1 20090322
Record2 20090101
Record3 20090601
Moderator message - Please search before asking and do not ask basic questions - post locked
Edited by: Rob Burbank on Jun 17, 2009 9:21 AM
06-17-2009 2:19 PM
Hi,
Sort the internal table by date in descending order and read the date in the first record of the internal table.
You will get the latest date.
Thanks,
Rakesh
06-17-2009 2:19 PM
Hi,
Sort the internal table by date in descending order and read the date in the first record of the internal table.
You will get the latest date.
Thanks,
Rakesh
06-17-2009 2:19 PM
Its easy...sort the internal table using the field i.e. date field in DESCENDING manner
SORT gt_final BY date_field DESCENDING.
Read the first entry of the internal table..it will have what you require
READ gt_final INDEX 1.