<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Total Pages in Basic List in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/total-pages-in-basic-list/m-p/1039075#M86019</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thankyou everyone.Special Thanks to Sailaja and Heilman.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Nov 2005 14:59:03 GMT</pubDate>
    <dc:creator>Murali_Shanmu</dc:creator>
    <dc:date>2005-11-08T14:59:03Z</dc:date>
    <item>
      <title>Total Pages in Basic List</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/total-pages-in-basic-list/m-p/1039068#M86012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I can find the current page number using sy-pagno. But how do i find total pages that are there. Like i want to display "Page number 1 of 8" at the bottom of every page.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2005 13:40:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/total-pages-in-basic-list/m-p/1039068#M86012</guid>
      <dc:creator>Murali_Shanmu</dc:creator>
      <dc:date>2005-11-08T13:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: Total Pages in Basic List</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/total-pages-in-basic-list/m-p/1039069#M86013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you know exactly the number of lines per page you can find the total pages dividing the total lines by the lines per page. I don't know a better way. I'm sorry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mireia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2005 13:51:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/total-pages-in-basic-list/m-p/1039069#M86013</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-08T13:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Total Pages in Basic List</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/total-pages-in-basic-list/m-p/1039070#M86014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is some sample code.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0004
       line-size 80
       line-count 65
       no standard page heading.

data: imara type table of mara with header line.

selection-screen begin of block b1 with frame title text-001 .
parameters: p_check type c.
selection-screen end of block b1.

start-of-selection.

  perform get_data.
  perform write_report.

top-of-page.

  perform top_of_page.

************************************************************************
*  FORM GET_DATA
************************************************************************
form get_data.

  select * into corresponding fields of table imara
        from mara up to 300 rows.

endform.

************************************************************************
*  FORM WRITE_REPORT
************************************************************************
form write_report.

  data: xpage(4) type c.

  loop at imara.
    write:/ imara-matnr.
  endloop.

  write sy-pagno to xpage left-justified.
  do sy-pagno times.
    read line 1 of page sy-index.
    replace '****' with xpage into sy-lisel.
    modify current line.
  enddo.

endform.

************************************************************************
*  Form  top_of_page
************************************************************************
form top_of_page.

  write:/32 'Test Program',
        at 62 'Page:', at 67 sy-pagno, 'of', '****'.

endform.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2005 13:56:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/total-pages-in-basic-list/m-p/1039070#M86014</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-11-08T13:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: Total Pages in Basic List</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/total-pages-in-basic-list/m-p/1039071#M86015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. But one more question. I am printing the page number in the End-Of-Page Event. Say suppose the last page has got just 2 lines. Then in this case the End-of-page is not getting fired and page number is not printed for last page alone. Any solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2005 14:18:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/total-pages-in-basic-list/m-p/1039071#M86015</guid>
      <dc:creator>Murali_Shanmu</dc:creator>
      <dc:date>2005-11-08T14:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: Total Pages in Basic List</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/total-pages-in-basic-list/m-p/1039072#M86016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shanmugham,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  We can get END-OF-PAGE triggered by taking the sy-linct, sy-linno count. Following is the sample code how to trigger it. In similar way, you can get end-of-page triggered by keeping track of SY-LINCT, SY-LINNO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Report zdemo1 line count 20(1).&lt;/P&gt;&lt;P&gt;Start-of-selection.&lt;/P&gt;&lt;P&gt;Data: m type i.&lt;/P&gt;&lt;P&gt;Write: / &amp;#145;this is first line&amp;#146;.&lt;/P&gt;&lt;P&gt;Do 5 times.&lt;/P&gt;&lt;P&gt;Write: / &amp;#145;the number is&amp;#146;, sy-index.&lt;/P&gt;&lt;P&gt;Enddo.&lt;/P&gt;&lt;P&gt;M = sy-linct, sy-linno &amp;#150; 1.&lt;/P&gt;&lt;P&gt;Skip x.&lt;/P&gt;&lt;P&gt;End-of-page.&lt;/P&gt;&lt;P&gt;Write: / &amp;#145;page end&amp;#146;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output of above example is as follows :&lt;/P&gt;&lt;P&gt;This is first line.&lt;/P&gt;&lt;P&gt;The number is 1&lt;/P&gt;&lt;P&gt;The number is 2&lt;/P&gt;&lt;P&gt;The number is 3&lt;/P&gt;&lt;P&gt;The number is 4&lt;/P&gt;&lt;P&gt;The number is 5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After skipping 10 lines&lt;/P&gt;&lt;P&gt;Page end&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case, with all write statement, you don&amp;#146;t reach to the end of page. After all write statement, m is calculated in this case:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;M = 20 &amp;#150; 8 &amp;#150; 1, So m is 12. And 11 lines are skipped after write statement and end of page is reached. (In this case you have 6 write statement so 6 lines + 1 line for page number and 1 horizontal line which is displayed for any list.  So cursor is on 8th line and is subtracted from total line count i.e, 20.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sailaja.&lt;/P&gt;&lt;P&gt;Dont forget to reward points if answer is helpful to you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2005 14:38:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/total-pages-in-basic-list/m-p/1039072#M86016</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-08T14:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Total Pages in Basic List</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/total-pages-in-basic-list/m-p/1039073#M86017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can skip n lines so that you can reach the end of line and therefore the end-of-page event is fired. If you can calculate the lines, that would solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mireia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2005 14:44:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/total-pages-in-basic-list/m-p/1039073#M86017</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-08T14:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: Total Pages in Basic List</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/total-pages-in-basic-list/m-p/1039074#M86018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I have modified my program a bit.  Pay close attention to the code in BOLD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0004
       line-size 80
       &amp;lt;b&amp;gt;line-count 65(1)&amp;lt;/b&amp;gt;
       no standard page heading.

data: imara type table of mara with header line.

selection-screen begin of block b1 with frame title text-001 .
parameters: p_check type c.
selection-screen end of block b1.

start-of-selection.

  perform get_data.
  perform write_report.

&amp;lt;b&amp;gt;end-of-page.

  perform end_of_page.&amp;lt;/b&amp;gt;

************************************************************************
*  FORM GET_DATA
************************************************************************
form get_data.

  select * into corresponding fields of table imara
        from mara up to 315 rows.

endform.

************************************************************************
*  FORM WRITE_REPORT
************************************************************************
form write_report.

  data: xpage(4) type c.
 &amp;lt;b&amp;gt; data: lines_left type i.&amp;lt;/b&amp;gt;

  loop at imara.
    write:/ imara-matnr.
&amp;lt;b&amp;gt;    at last.
      if sy-linno &amp;lt; 64.
        lines_left = ( sy-linct - sy-linno ) - 1.
          skip lines_left.
          sy-pagno = sy-pagno - 1.
      elseif sy-linno = 64.
      skip 1.
       sy-pagno = sy-pagno - 1.
      endif.
    endat.&amp;lt;/b&amp;gt;
  endloop.

  write sy-pagno to xpage left-justified.
  do sy-pagno times.
    read line 65 of page sy-index.
    replace '****' with xpage into sy-lisel.
    modify current line.
  enddo.

endform.

************************************************************************
*  Form  end_of_page
************************************************************************
&amp;lt;b&amp;gt;form end_of_page.

  write:/32 'Test Program',
        at 62 'Page:', at 67 sy-pagno, 'of', '****'.

endform.&amp;lt;/b&amp;gt;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2005 14:48:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/total-pages-in-basic-list/m-p/1039074#M86018</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-11-08T14:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: Total Pages in Basic List</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/total-pages-in-basic-list/m-p/1039075#M86019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thankyou everyone.Special Thanks to Sailaja and Heilman.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2005 14:59:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/total-pages-in-basic-list/m-p/1039075#M86019</guid>
      <dc:creator>Murali_Shanmu</dc:creator>
      <dc:date>2005-11-08T14:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: Total Pages in Basic List</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/total-pages-in-basic-list/m-p/1039076#M86020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to get current secondary line data by using sy-lisel.But following codde not work .sy-lisel just includes previous first basis list line data. Why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  PERFORM GF_GET_TCDATA.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  SET PF-STATUS 'STATUS_100'.&lt;/P&gt;&lt;P&gt;  PERFORM PRINT_LIST.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;AT LINE-SELECTION.&lt;/P&gt;&lt;P&gt; IF SY-LSIND = 1.&lt;/P&gt;&lt;P&gt;    SET PF-STATUS 'STATUS_100'.&lt;/P&gt;&lt;P&gt;    PERFORM PRINT_DETAIL.&lt;/P&gt;&lt;P&gt;    PERFORM UPDATE_PAGTOTAL.&lt;/P&gt;&lt;P&gt; ENDIF.&lt;/P&gt;&lt;P&gt; ...... &lt;/P&gt;&lt;P&gt; FORM  UPDATE_PAGTOTAL.&lt;/P&gt;&lt;P&gt;  DATA: xpage(4) TYPE c.&lt;/P&gt;&lt;P&gt;  WRITE sy-pagno TO xpage LEFT-JUSTIFIED.&lt;/P&gt;&lt;P&gt;  DO sy-pagno TIMES.&lt;/P&gt;&lt;P&gt;    READ LINE 6 OF PAGE sy-index.&lt;/P&gt;&lt;P&gt;    REPLACE '***' WITH xpage INTO sy-lisel.&lt;/P&gt;&lt;P&gt;    MODIFY CURRENT LINE.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt; ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2005 08:56:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/total-pages-in-basic-list/m-p/1039076#M86020</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-05T08:56:13Z</dc:date>
    </item>
  </channel>
</rss>

