Application Development 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: 

Total Page Numbers

Former Member
0 Kudos

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.

9 REPLIES 9

Former Member
0 Kudos

Current page is PAGNO

0 Kudos

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

Former Member
0 Kudos

Hi vincent

current pagenumber is sy-pageno

regards

kishore

Former Member
0 Kudos

Hi,

SY-PAGNO has the current page value.

U could check this.

Thanks & Regards,

Ankur

former_member188685
Active Contributor
0 Kudos

Hi,

Check this link..

Regards

vijay

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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'.

'+++++'.

  1. 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.

Lakshmant1
Active Contributor
0 Kudos

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