Can anyone help me with this question?

hi experts
Now I am writing a report and I have to get the number of how many pages is going to be displayed.
How can I know this? I know there is a system variantsy-pagnocontains the current page number, but is there any variant that can tell me how many pages are there?
many thanks...

REPORT Y_WA no standard page heading line-count 60(5).
data: v_totpage type i.
data: v_temp(3) type c.
Start-of-selection.
do 100 times.
write:/ sy-index.
enddo.
end-of-selection.
v_temp = v_totpage.
do v_totpage times.
read line 1 of page sy-index.
replace '@@@' in sy-lisel with v_temp.
modify line 1 of page sy-index.
enddo.
top-of-page.
write:/60 'page', sy-pagno, '/','@@@'.
v_totpage = sy-pagno.
Here is a sample:
zlines number of lines in the table
sy-srows number of lines in screen
sy-cpage current page
zpages total number of pages type i
temp temporary number type f
describe table itab lines zlines.
temp = zlines / sy-srows.
zpages = trunc( temp ).
temp = frac( temp ).
if temp > 0.
zpages = zpages + 1.
endif.
zpages is the number of pages
write: /'Page ',sy-cpage, ' of ', zpages.

Similar Messages

Maybe you are looking for

  • Can't connect to HP Laserjet 4mp

    I'm in desperate need of some help and hadn't found any reference to this question in the forums. I have a Macbook Pro running 10.6.4 connected to a D-link DI 604 router which is connected to an HP Laserjet 4MP printer. Ever since I upgraded to Snow

  • 10.2.1 is available in Canada for the users of Rogers

    I am just starting to download it and I will be reporting on the official upgrade as soon as it is done Using the Playbook and the Z10 and the Z30 and loving them Martin

  • Overview Missing Parts

    Hi All, In a production order there is an Overview for missing parts.  It has information like committed quantity and committed date.  We are looking for a standard SAP report that would give us this information by production order and material inste

  • Database link from one Oracle database to another

    Hi everyone! I have 2 databases. I need to create a database link to copy a table from one of the database to another. Both of them are Oracle 10g v2 Please advice me on how can I go about it. I am trying to avoid import and export. What are the opti

  • CC 2014 Using "Edit in Adobe Audition" question?

    In Premiere Pro CC (2014). When I send an audio clip that is an .aif from the timeline to Audition using "Edit in Adobe Audition > Clip", when it shows up in Audition, the file is a .wav file. Is there a preference that will keep it a .aif file?