2005 Sep 07 8:00 AM
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
2005 Sep 07 8:05 AM
2005 Sep 07 8:53 AM
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.
2005 Sep 07 9:35 AM
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
2005 Sep 07 1:04 PM
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.
2005 Sep 23 5:15 AM
Phani,
If your problem is solved, kindly reward suitable points and close this thread.
Rgds,
Prash.
2005 Sep 23 5:53 AM
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
2007 Aug 08 10:55 AM
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..