Writing at the end of report without clearing current screen in SAP ABAP

Yes, it is possible to write at the end of a report without clearing the current screen in SAP ABAP. You can achieve this by using the MODIFY LINE statement, which allows you to update specific lines on the screen without clearing the entire display.

Using MODIFY LINE Statement

The MODIFY LINE statement enables you to modify existing lines in the output list without affecting other content on the screen. This is particularly useful when you want to append information or update specific parts of your report output.

Basic Syntax

The basic syntax for using MODIFY LINE is ?

MODIFY LINE line_number [OF PAGE page_number] 
       [LINE FORMAT format_options]
       [LINE COLOR color_option].

Example

Here's a practical example of how to use MODIFY LINE to append content without clearing the screen ?

REPORT z_modify_line_example.

DATA: lv_line_number TYPE i.

START-OF-SELECTION.
  " Write initial content
  WRITE: / 'Initial Report Content'.
  WRITE: / 'Line 2 of the report'.
  WRITE: / 'Line 3 of the report'.
  
  " Get current line number
  lv_line_number = sy-linno.
  
  " Add content at the end without clearing screen
  MODIFY LINE lv_line_number.
  WRITE: / 'Additional content added without clearing screen'.
  WRITE: / 'This appears at the end of existing content'.

Alternative Approaches

You can also use SKIP TO LINE statement to position the cursor at a specific line before writing new content, or use NEW-LINE to ensure proper line breaks when appending content.

Conclusion

The MODIFY LINE statement provides an effective way to append content to SAP ABAP reports without clearing the current screen display, allowing for dynamic report updates while preserving existing content.

Updated on: 2026-03-13T18:45:09+05:30

223 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements