‎2009 Jan 02 9:58 PM
I am using cl_salv_table=>factory( IMPORTING r_salv_table = l_table
CHANGING t_table = IT_EMPS ).
to display my alv.
I want to display a row with text as total records value: some value
at the end of the alv result and at the same time i want to display page no dynamically.
‎2009 Jan 06 7:46 AM
Hi Srilakshmi,
Try to use SET_TOP_OF_LIST and SET_END_OF_LIST methods in the Class Interface CL_SALV_TABLE.
For value you can use SET_TOP_OF_LIST method and for Page Number you can use SET_END_OF_LIST.
Thanks
Prabhu
‎2009 Jan 06 7:46 AM
Hi Srilakshmi,
Try to use SET_TOP_OF_LIST and SET_END_OF_LIST methods in the Class Interface CL_SALV_TABLE.
For value you can use SET_TOP_OF_LIST method and for Page Number you can use SET_END_OF_LIST.
Thanks
Prabhu
‎2009 Jan 06 5:52 PM
Thanks but still am not getting page numbers in all pages its displaying only in 1st page
can u help me out how to get the page no dynamically using
SET_TOP_OF_LIST
‎2012 Jul 31 6:11 AM
Hi,
I know this is an old post, but I was looking for the same thing and found the following solution. So I thought I would reply in case any one needs to know how to do it.
1) Create a method to handle your page header
* Definition
top_of_page_handler FOR EVENT top_of_page OF cl_salv_events_table
METHODS:
top_of_page_handler FOR EVENT top_of_page OF cl_salv_events_table
* Implementation
METHOD top_of_page_handler.
WRITE😕 'Page No:', sy-pagno.
ENDMETHOD. "top_of_page_handler
2) Get the current event table (cl_salv_events_table) instance for your alv table (cl_salv_table)
DATA: lo_event TYPE REF TO cl_salv_events_table.
lo_event = im_alv_table->get_event( ).
3) Set your method as handler for the top of page event
SET HANDLER top_of_page_handler FOR lo_event.
Now when the list is output to spool. This code will trigger at each new page. Take a look at the other events in cl_salv_events_table.
Enjoy,
Katan