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

Report Display

Former Member
0 Likes
632

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
611

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.

6 REPLIES 6
Read only

Former Member
0 Likes
612

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.

Read only

0 Likes
611

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.

Read only

0 Likes
611

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.

Read only

Former Member
0 Likes
611

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

Read only

Former Member
0 Likes
611

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.

Read only

Former Member
0 Likes
611

solved