‎2006 Oct 20 7:18 AM
Hi,
In a report from the intrnal table i sort descending by date.but i want to display the top first data should be displayed in a field1 and the top second data should be displayed in the field2.means the field 1 is the latest updated and the field 2 is last updated(befor the latest updated).They want to see the latest updated data and the previously updated(before the latest)data. so help me to display this prog.
Thanks,
Raj.
‎2006 Oct 20 7:20 AM
Hi,
You can use control statement at first and at last in the loop.
After sorting the internal table.
Loop at itab.
at first.
***display first record
at last.
display last record
endloop.
or if you want first and second record then just read the internal table with index.
sort the internal table.
read table itab index 1.
read table itab index 2.
Hope this helps.
‎2006 Oct 20 7:20 AM
Hi,
You can use control statement at first and at last in the loop.
After sorting the internal table.
Loop at itab.
at first.
***display first record
at last.
display last record
endloop.
or if you want first and second record then just read the internal table with index.
sort the internal table.
read table itab index 1.
read table itab index 2.
Hope this helps.
‎2006 Oct 20 7:31 AM
Hi,
use method of Ahmed (read your desc. sorted tab with index 1 and 2) , but put values in a new itab with the fields field1 and field2.
A.
‎2006 Oct 20 8:00 AM
Hi,
Here i getting for the one material only,but i want to show for multiple material no.the index is taking for the first material no of the latest updated data and last updated dated date based on sort by descending the date.but my requirement is to display for all the material no i want to show the latest and last updated data.help me to solve it.
Thanks,
Raj.
‎2006 Oct 20 7:30 AM
Hi Rajendra
Sort by date itself might not solve your case.
Please try to find another field which can differentiate the latest, maybe some thing like time or document number.
After finding another field for the same, sort internal table with both fields descending and then read by index 1 & 2 to retreive the latest and the last before latest.
Kind Regards
Eswar
‎2006 Oct 20 8:17 AM
Hi,
Here i getting for the one material only,but i want to show for multiple material no.the index is taking for the first material no of the latest updated data and last updated dated date based on sort by descending the date.but my requirement is to display for all the material no i want to show the latest and last updated data.help me to solve it.
Thanks,
Raj.
‎2009 Sep 17 2:56 AM