<?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 explain the logic in the code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/explain-the-logic-in-the-code/m-p/4531996#M1071069</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone explain the logic in the code ?&lt;/P&gt;&lt;P&gt;This is to display the pages numbers in page 1 of 4&lt;/P&gt;&lt;P&gt;                                                         page 2 of 4 &lt;/P&gt;&lt;P&gt;format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i got this code in one of the forum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the lineno is less then 64, then why the control is not executing lines_left and its followed by statements ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  zreport_pages LINE-SIZE 80 LINE-COUNT 65(1) NO STANDARD PAGE HEADING.&lt;/P&gt;&lt;P&gt;DATA: imara TYPE TABLE OF mara WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001 .&lt;/P&gt;&lt;P&gt;PARAMETERS: p_check TYPE c.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  PERFORM get_data.&lt;/P&gt;&lt;P&gt;  PERFORM write_report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-PAGE.&lt;/P&gt;&lt;P&gt;  PERFORM end_of_page.&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*FORM GET_DATA .&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;FORM get_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT * INTO CORRESPONDING FIELDS OF TABLE imara&lt;/P&gt;&lt;P&gt;  FROM mara UP TO 315 ROWS.&lt;/P&gt;&lt;P&gt;ENDFORM.                    "get_data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*FORM WRITE_REPORT .&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;FORM write_report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: xpage(4) TYPE c.&lt;/P&gt;&lt;P&gt;  DATA: lines_left TYPE i.&lt;/P&gt;&lt;P&gt;  LOOP AT imara.&lt;/P&gt;&lt;P&gt;    WRITE:/ imara-matnr.&lt;/P&gt;&lt;P&gt;    AT LAST.&lt;/P&gt;&lt;P&gt;      IF sy-linno &amp;lt; 64.&lt;/P&gt;&lt;P&gt;        lines_left = ( sy-linct - sy-linno ) - 1.&lt;/P&gt;&lt;P&gt;        SKIP lines_left.&lt;/P&gt;&lt;P&gt;        sy-pagno = sy-pagno - 1.&lt;/P&gt;&lt;P&gt;      ELSEIF sy-linno = 64.&lt;/P&gt;&lt;P&gt;        SKIP 1.&lt;/P&gt;&lt;P&gt;        sy-pagno = sy-pagno - 1.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&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 65 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.                    "write_report&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*************************************************************************&lt;/P&gt;&lt;P&gt;**Form end_of_page .&lt;/P&gt;&lt;P&gt;*************************************************************************&lt;/P&gt;&lt;P&gt;FORM end_of_page.&lt;/P&gt;&lt;P&gt;WRITE:/32 'Test Program', AT 62 'Page:', AT 67 sy-pagno, 'of', '****'.&lt;/P&gt;&lt;P&gt;ENDFORM.                    "end_of_page&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;krupali&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Sep 2008 06:49:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-09-30T06:49:57Z</dc:date>
    <item>
      <title>explain the logic in the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/explain-the-logic-in-the-code/m-p/4531996#M1071069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone explain the logic in the code ?&lt;/P&gt;&lt;P&gt;This is to display the pages numbers in page 1 of 4&lt;/P&gt;&lt;P&gt;                                                         page 2 of 4 &lt;/P&gt;&lt;P&gt;format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i got this code in one of the forum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the lineno is less then 64, then why the control is not executing lines_left and its followed by statements ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  zreport_pages LINE-SIZE 80 LINE-COUNT 65(1) NO STANDARD PAGE HEADING.&lt;/P&gt;&lt;P&gt;DATA: imara TYPE TABLE OF mara WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001 .&lt;/P&gt;&lt;P&gt;PARAMETERS: p_check TYPE c.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  PERFORM get_data.&lt;/P&gt;&lt;P&gt;  PERFORM write_report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-PAGE.&lt;/P&gt;&lt;P&gt;  PERFORM end_of_page.&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*FORM GET_DATA .&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;FORM get_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT * INTO CORRESPONDING FIELDS OF TABLE imara&lt;/P&gt;&lt;P&gt;  FROM mara UP TO 315 ROWS.&lt;/P&gt;&lt;P&gt;ENDFORM.                    "get_data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*FORM WRITE_REPORT .&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;FORM write_report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: xpage(4) TYPE c.&lt;/P&gt;&lt;P&gt;  DATA: lines_left TYPE i.&lt;/P&gt;&lt;P&gt;  LOOP AT imara.&lt;/P&gt;&lt;P&gt;    WRITE:/ imara-matnr.&lt;/P&gt;&lt;P&gt;    AT LAST.&lt;/P&gt;&lt;P&gt;      IF sy-linno &amp;lt; 64.&lt;/P&gt;&lt;P&gt;        lines_left = ( sy-linct - sy-linno ) - 1.&lt;/P&gt;&lt;P&gt;        SKIP lines_left.&lt;/P&gt;&lt;P&gt;        sy-pagno = sy-pagno - 1.&lt;/P&gt;&lt;P&gt;      ELSEIF sy-linno = 64.&lt;/P&gt;&lt;P&gt;        SKIP 1.&lt;/P&gt;&lt;P&gt;        sy-pagno = sy-pagno - 1.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&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 65 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.                    "write_report&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*************************************************************************&lt;/P&gt;&lt;P&gt;**Form end_of_page .&lt;/P&gt;&lt;P&gt;*************************************************************************&lt;/P&gt;&lt;P&gt;FORM end_of_page.&lt;/P&gt;&lt;P&gt;WRITE:/32 'Test Program', AT 62 'Page:', AT 67 sy-pagno, 'of', '****'.&lt;/P&gt;&lt;P&gt;ENDFORM.                    "end_of_page&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;krupali&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Sep 2008 06:49:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/explain-the-logic-in-the-code/m-p/4531996#M1071069</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-30T06:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: explain the logic in the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/explain-the-logic-in-the-code/m-p/4531997#M1071070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi KR,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This program just displays first 315 MATNR values from MARA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Every page consists of 65 lines. At bottom of every page, page number and total page number want to be displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is checked that last page is filled or incomplete.&lt;/P&gt;&lt;P&gt;If incomplete, those lines are skipped, Just to display page number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before that at the end of every page, "PAGE NO 1 OF ****" will be displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After filling last page, the 'TOTAL NUMBER OF PAGES' at the end of every page '*****' replaced by original value.&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;R.Nagarajan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2008 02:29:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/explain-the-logic-in-the-code/m-p/4531997#M1071070</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-01T02:29:52Z</dc:date>
    </item>
  </channel>
</rss>

