Generating Blank Lines in the Output - ABAP Programming Tricks


Blank Lines in the Output Screen.

While generating a report, ABAPers need at some point of time a blank line in the output screen.
It is bit hard to achieve it as Blank Lines will be ignored by the ABAP runtime environment.

To overcome this situation, SAP has provided SET BLANK LINES statement with ON and OFF options.

Let us see this with an example code and output.

Code

WRITE '*****'.

NEW-PAGE.

SET BLANK LINES OFF.

DO 5 TIMES.
  WRITE / ' '.
ENDDO.

WRITE '*****'.

NEW-PAGE.

SET BLANK LINES ON.
DO 5 TIMES.
  WRITE / ' '.
ENDDO.
SET BLANK LINES OFF
WRITE  / '*****'.

Output



.




As you see above code and the output, SKIP statement skips 5 lines in the output screen.
But it is not the right approach. Use the SET BLANK LINES statement for any blank lines to be displayed in the output screen.


For more Tutorials, visit ABAP Tutorials, Tips & Tricks and Certification Questions

No comments:

Post a Comment