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: 

Number of pages in ALV Report

Former Member
0 Kudos
141

Hi all,

Can we display current page and number of pages (Ex. 1 of 10) in an ALV report at TOP-OF-PAGE? Could you please suggest me?

Regards,

Phani

7 REPLIES 7

Vinod_Chandran
Active Contributor
0 Kudos
91

Hi,

Please see the following post for the answer.

Thanks

Vinod

Former Member
0 Kudos
91

Hi Phani,

you will have to print the 'Page <pg> of' initially the way somebody else suggested...

at this time, you will not know how many pages are going to be there totally...

once your list display is over, you will have to do a read line and read the report display and append the total pages after Page <pg> of ...

Hope this helps.

Remember 2 reward points if this post answered ur Q.

Rgds,

Prash.

0 Kudos
91

Hi Prasanth,

Thanx for your reply. Once the output table is passed to the ALV FM, how can we read the report display and append the total pages? Can you explain it elaborately?

Rgrds,

Phani

0 Kudos
91

hi Phani,

This wont be possible in a Grid ALV.

but you can do this with a alv list, because there is no difference between an ordinary list and an alv list.

REPORT ZREADLINE no standard page heading.

data:

tot_page(3) type c,

l_pg type i,

l_line(80).

top-of-page.

write:/ 'Page: ' , sy-pagno.

start-of-selection.

do 5 times.

write:/ sy-datum.

do 20 times.

write:/ 'TEST'.

tot_page = sy-pagno.

enddo.

new-page.

enddo.

end-of-selection.

do tot_page times.

l_pg = sy-index.

do 20 times.

read line sy-index of page l_pg line value into l_line.

if l_line+0(4) = 'Page'.

concatenate l_line 'of' tot_page into l_line separated by ' '.

modify line sy-index line value from l_line.

endif.

enddo.

enddo.

This program that I have given above - since I dont have an alv, i have simulated teh output of an alv with write statements.

You can use the logic in the end-of-selection part...

Remember 2 reward points if this answers your question.

Rgds,

Prashanth.

0 Kudos
91

Phani,

If your problem is solved, kindly reward suitable points and close this thread.

Rgds,

Prash.

0 Kudos
91

Hi Prasanth,

Thanks for remembering me. But my problem is not solved. TOP-OF-PAGE is static, it is not triggering for each page. Same information is coming on every page. Unfortunately, my local server was scrap to paste the code i have done. Any how, I will close the thread now

Regards,

Phani

Former Member
0 Kudos
91

Hi guys,

can somebody tell me on how to get the total pages of the ALV report since I used page breaks for my ALV? and the total pages of the report should be in my header of my ALV?

i hope somebody can help me..thanks..