Remove Header on Last Page in Classical Report

By | September 6, 2008 | Classical | 5,726 | 1

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(2NO STANDARD PAGE HEADING.

START-OF-SELECTION.
* Generating the Output
  DO 30 TIMES.
    WRITE/ sy-abcde.
  ENDDO.


* Clearing the last TOP-OF-PAGE
  READ LINE OF PAGE sy-pagno.
  CLEAR sy-lisel.
  MODIFY LINE 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
  DATAl_cnt TYPE i,
        l_line TYPE i.
  CLEARl_cntl_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'.

Like It? Share!!

Don't miss an Update

Get notified of the new post, right into your inbox

Naimesh Patel{274 articles}

I'm SAP ABAP Consultant for more than a decade. I like to experiment with ABAP especially OO. I have been SDN Top Contributor.
Follow :

Explore all of his 274 articles.

Load comments

1 Comment

  • Hi,

    How can we design the report with Multiple Headings horizontly and sorted on the basis of different heading either in Classical or ALV report.
    Please suggest.

Comments on this Post are now closed. If you have something important to share, you can always contact me.

You seem to be new here. Subscribe to stay connected.