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 x of y.

Former Member
0 Kudos

hi,

I have written abap report program through write statement. printing of the report is done vendor wise. suppose for vendor1 there are 3 pages, so in the header it should display page 1/3, page 2/3 and page 3/3, for next vendor suppose vendor2 there are 5 pages, so in the header it should display page 1/5,page 2/5,page 3/5,page 4/5,page 5/5. currently i have written code but it doesnt display pages vendor wise, if we take above example of vendor1 and vendor2, my code display as page 1/8, 2/8, 3/8 likewise... my code is as given below.

l_page_count = v_totpage.

DO v_totpage TIMES.

READ LINE 6 OF PAGE sy-index.

REPLACE '---' INTO sy-lisel with l_page_count.

MODIFY LINE 6 OF PAGE sy-index.

ENDDO.

WRITE :/1 sy-vline, 10 'Company Code:' , 24 p_bukrs, 84 'PAGE' , sy-pagno ,'Of ', '---', 231 sy-vline.

v_totpage = sy-pagno.

LOOP AT it_final.

  • Displaying each Vendor on new page.

ON CHANGE OF it_final-lifnr.

NEW-PAGE.

ENDON.

endloop.

kindly advise what change i should do in above program.

4 REPLIES 4

former_member188685
Active Contributor
0 Kudos

check this..

Former Member
0 Kudos

no my problem is different. it should count pages vendor wise.

arpit_shah
Contributor
0 Kudos

hi ,

put condition,

if vendor is changed then i_page_count will be initialized with value 1.

and add 1 up to next page until next vendor not comes.

Former Member
0 Kudos

now i have changed code like this.

DO v_totpage TIMES.

READ LINE 6 OF PAGE sy-index.

REPLACE '---' INTO sy-lisel with l_page_count.

MODIFY LINE 6 OF PAGE sy-index.

ENDDO.

WRITE :/1 sy-vline, 10 'Company Code:' , 24 p_bukrs, 84 'PAGE' , sy-pagno ,'Of ', '---', 231 sy-vline.

v_totpage = sy-pagno.

LOOP AT it_final.

ON CHANGE OF it_final-lifnr.

l_page_count = 1.

NEW-PAGE.

ENDON.

endloop.

but it is not working. now for first vendor it is showint page 1/1 and for second vendor it is showing page 2/1. actully for second vendor also it should display page 1/1.