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

page number in alv

Former Member
0 Kudos

Hi experts,

i want to display pagenumber and total no of pages like 1 of 5 in ALV when Listoutput is selected please say some ideas or possible few example....

Regards,

vino.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

If you want to display the page number information, you have to put it in

the exporting parameter "IT_LIST_COMMENTARY" in the form "TOP-OF-PAGE"of

your program, and not in a preceding part.

For example:

FORM top_of_page.

DATA: ls_line TYPE slis_listheader.

REFRESH gt_list_top_of_page.

CLEAR ls_line.

ls_line-typ = 'S'.

ls_line-key = 'Page number:'.

ls_line-info = sy-pagno.

APPEND ls_line TO gt_list_top_of_page.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = gt_list_top_of_page.

ENDFORM.

If you want to make a test, just add "WRITE : SY-PAGNO" to the form

"TOP-OF-PAGE" of your program.

2 REPLIES 2

Former Member
0 Kudos

Hi,

If you want to display the page number information, you have to put it in

the exporting parameter "IT_LIST_COMMENTARY" in the form "TOP-OF-PAGE"of

your program, and not in a preceding part.

For example:

FORM top_of_page.

DATA: ls_line TYPE slis_listheader.

REFRESH gt_list_top_of_page.

CLEAR ls_line.

ls_line-typ = 'S'.

ls_line-key = 'Page number:'.

ls_line-info = sy-pagno.

APPEND ls_line TO gt_list_top_of_page.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = gt_list_top_of_page.

ENDFORM.

If you want to make a test, just add "WRITE : SY-PAGNO" to the form

"TOP-OF-PAGE" of your program.

Former Member
0 Kudos

You can give sy-pagno for the current page number in the TOP-OF-PAGE EVENT and about the total number of page just check the number of line which can be in a single page from the internal table you are passing to alv

Edited by: Midhun Abraham on Sep 26, 2008 6:55 AM