To achieve the above goal you have to follow the steps as specified by soumya. i.e you have to use a TSQ to store the data. Along with that you can use three variables to keep track of
1: Total no. of records prsent in the TSQ (Tot-Rec ).
2: Total no. records displayed in the current screen (Rec-Disp).
3: Last record displayed (Last-Rec-Disp).
Example : If you are having 35 records in the TSQ and in a screen you are displaying 12 records.
If you are in the 2nd screen Tot-Rec 35 Rec-Disp 12 & Last-Rec-Disp 24. If you are in last screen Tot-Rec 35 Rec-Disp 11 & Last-Rec-Disp 35.
For both F7 and F8 1st set the starting point from where you have to start displaying the records and start displaying 12 records in a loop. If no records are available in the TSQ to display then display spaces.