Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV report by using OOPS

Former Member
0 Likes
783

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
617

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

3 REPLIES 3
Read only

Former Member
0 Likes
618

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

Read only

Former Member
0 Likes
617

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

Read only

Katan
Active Participant
0 Likes
617

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