04-19-2005 5:12 PM
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
04-19-2005 10:56 PM
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.
Thanks.
Kshitij
04-20-2005 4:11 PM
Thanks Kshitij,
I'll have to try this out. I still wish there was a "cleaner" way to do this.