02-04-2011 9:10 AM
Hello All,
I have used the class "CL_SALV_HIERSEQ_TABLE" to display Hierarchical-Sequential ALV.
I have got the event TOP_OF_PAGE from the method GET_EVENT and using this event
I am able to print the current page number(event has exporting parameter page)
on every page while printing.
Now I require the total no.of pages so that I can print in x of YY method.
x - currrent page
YY - total no.of pages.
As this is Hierarchical ALV I dont think it is a good idea to count the total no.of records
in internal table and calculate the no.of pages.
Help me in solving this
With regards,
Sandeep akella
Edited by: sandeep akella on Feb 4, 2011 10:20 AM
02-05-2011 10:29 PM
Hello Sandeep,
I do not think there is a parameter / attribute to get the total number of pages. If you look at the call stack then the page number is also from the field SY-PAGNO (Current List Page). Hence I think you will have to calculate the total number of pages using the number of rows being displayed on the screen and the number of rows in the table as suggested in a lot of other posts on SDN.
Thank you,
Ramneek
02-06-2011 2:40 AM
Hello Ramneek,
But how can we calculate the no.of lines that can excatly fit in a page, because in normal ALV the rows are fixed
so by counting the no.of records in internal table we can come to a conclusion. But in hierarchical ALV there is user action involved with expanding the rows as well as closing them, changing the layout like making header or item details to appear in line1,line2 and line3. So I think it is very difficult in that way.
Could you please suggest any other method for this.
With regards,
sandeep akella.
02-06-2011 7:04 PM
Hi sandeep,
page totals online with user interaction does not make much sense - you may display the total number of table lines here.
When printed, the page number depends on the used printer format. You may count pages in top-of-page event.
Regards,
Clemens
02-07-2011 6:52 AM
Hello all,
Can we redefine the standard method for top_of_page event, so that the text is not printed,
but rather prepared for printing and buffered. Then we can manipulate it like we do in classical reporting or
Pick up the spool request after the program is finished and modify its data before printing and then print.
with regards,
sandeep akella.
03-22-2011 8:44 AM
An option for selecting 1. display in ALV and 2. Print in classical report is provided in the selection screen.
Depending on the selection ALV or classical report is dispalyed.
In Heirarchical ALV the option of print and print preview are disabled by setting the set_print method of class cl_salv_functions_list to flase.