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.
Showing results for 
Search instead for 
Did you mean: 

Total pages in ALV printout.

Former Member
0 Kudos

I have an ALV list/grid which needs to be printed with a header containing something like:

Page 1 of 30

I'm able to get the page numbers correctly from SY-PAGNO in the top of page event. However, getting the total (maximum) pages seems to be quite difficult. Has anyone sucessfully done this before in ALV?

Any help/suggestions would be much appreciated!

- Suresh Vijay


Former Member
0 Kudos

Hi Suresh,

I am know of a cludy way to achieve this;

1. Through your main program call another program which will display your alv in the SAP spool;

submit <prog name> with insdatum in insdatum

with p2000 = p_att

with p2010 = p_ee

with p2003 = p_sub

with protokol = p_out

with sendmail = p_mail

with TESTLAUF = p_test

to sap-spool <- very important

spool parameters params

without spool dynpro.

This is show your list to the spool but would have the total no. of pages generated.

2. Now using the spool# generated, read the table TSP01 field RQAPPRULE to get the total no. of pages.

3. Use that value and then call your alv again on the screen through your main program.



0 Kudos

Thanks Kshitij,

I'll have to try this out. I still wish there was a "cleaner" way to do this.