02-13-2006 11:27 AM
How to get the current page number out of total page numbers. ie. Page # 2 of 10 (2 is current page nuber and 10 is the total number of pages) in the ABAP reports.
02-13-2006 11:31 AM
02-13-2006 11:36 AM
use event
END-OF-PAGE.
Current number of pages is sy-pagno
and user sy-lilli (current list line) to determine the number of pages!
for example : first end of page lilli contains 50 means that you can display 50 lines on one page! If the entries you display are about 213 you can determine there will be 5 pages ! Bingo!
Thanks for any rewardè!s
02-13-2006 11:35 AM
02-13-2006 11:40 AM
Hi,
SY-PAGNO has the current page value.
U could check this.
Thanks & Regards,
Ankur
02-13-2006 11:51 AM
02-13-2006 11:56 AM
Hi,
You can use sy-pagno for get the current page number.
If you want both current page as well as total number of pages then you can check the total numbers of records in the internal table.
Then you can set how many records you want to display in a single page.
So, Total Pages = (total records)/(number of records in one page).
Regards,
Neeraj Gupta
02-13-2006 11:57 AM
Hi
You can't write that at runtime, because the system'll can know the total number of pages only at the end.
So you should write a little code to re-place the TOTAL NUMBER of pages at the end.
While writine the page you can write:
WRITE: SY-PAGNO, '/', '******'.
AT the end the variable SY-PAGNO is the total pages, so you should replace that value.
So read all the lines listed (See READ LINE command) and replace ****** with SY-PAGNO (See MODIFY LINE command).
Max
02-13-2006 1:43 PM
hi vincent,
check the following code:
TOP-OF-PAGE.
dg_lines = sy-pagno.
so, if u have 3 pages, dg_lines will have the value of '3'
initially for the value of total number of pages, just give some value '+++++' .
write : sy-pagno,
'of'.
'+++++'.
end of top of page
end of selection.
when u r writing the output,
do dg_lines times.
REPLACE '+++++' WITH dg_lines INTO sy-lisel.
MODIFY CURRENT LINE.
enddo.
try this, it will solve ur problem
get back to me if u still didn't get
thanks,
mahesh.
02-13-2006 1:56 PM
Hi Vincent,
Check the source code,
REPORT ZPAGETEST NO STANDARD PAGE HEADING LINE-SIZE 40
LINE-COUNT 20.
DATA:COUNT(6) TYPE N.
DATA: LAST_PAGE_NO LIKE SY-PAGNO.
DATA: TOTPAGE(6) TYPE C .
TOP-OF-PAGE.
WRITE:20 SY-PAGNO ,'of', '££££££'.
START-OF-SELECTION.
DO 100 TIMES.
WRITE: / COUNT.
COUNT = COUNT + 1.
ENDDO.
LAST_PAGE_NO = SY-PAGNO.
TOTPAGE = SY-PAGNO.
DO LAST_PAGE_NO TIMES.
READ LINE 1 OF PAGE SY-INDEX .
REPLACE '££££££' WITH TOTPAGE INTO SY-LISEL.
MODIFY CURRENT LINE.
ENDDO.
Thanks
Lakshman