Posted: Tue Sep 11, 2007 6:43 pm Post subject: Total Number of Pages of a Report Output
Using TOP-OF-PAGE event to find out total no of pages of a report output.
Check this below code. You will get the clear idea.
Code:
REPORT YJAM_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.
* 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.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.