Remove Header on Last Page in Classical Report

Posted by Krishh Webworld | 6:19 PM | , , | 1 comments »

This code provides logic to remove the Header generated by TOP-OF-PAGE from the Last Page.


CODE Snippet
*&---------------------------------------------------------------------*
*& Report ZTEST_NP_TOP_LAST *

*&---------------------------------------------------------------------*

*& Example of how to remove the header generated by TOP-OF-PAGE and *

*& Move the LIST upwards in the space of the TOP-OF-PAGE *

*& *

*&---------------------------------------------------------------------*


REPORT ZTEST_NP LINE-COUNT 10(2) NO STANDARD PAGE HEADING.


START-OF-SELECTION.
* Generating the Output
DO 30 TIMES.
WRITE: / SY-ABCDE.
ENDDO.


* Clearing the last TOP-OF-PAGE
READ LINE 1 OF PAGE SY-PAGNO.
CLEAR SY-LISEL.
MODIFY LINE 1 OF PAGE SY-PAGNO.


* Moving list upword
* Here we are moving only 2 lines, as we have only 2
* lines in our TOP-OF-PAGE
DATA: L_CNT TYPE I,
L_LINE TYPE I.
CLEAR: L_CNT, L_LINE.
L_LINE = 2.
DO.
L_CNT = L_CNT + 1.
L_LINE = L_LINE + 1.
READ LINE L_LINE OF PAGE SY-PAGNO.
IF SY-SUBRC NE 0.
EXIT.
ELSE.
MODIFY LINE L_CNT OF PAGE SY-PAGNO.
CLEAR SY-LISEL.
MODIFY LINE L_LINE OF PAGE SY-PAGNO.
ENDIF.
ENDDO.

* Top of page
TOP-OF-PAGE.
WRITE: / 'Heading from TOP OF PAGE Line 1'.
WRITE: / 'Line 2'.

Archives

Subscribe Now: Feed Icon