Show TOC

Improving the LayoutLocate this document in the navigation structure

Use

You use this procedure to format your source code in the ABAP Editor. The ABAP source code is stored in the database in unformatted form.

However, you can use the Pretty Printer to standardize the layout of your program. It also groups together statements that logically belong together by indenting statement blocks.

See also:

Features of the Pretty Printer

Procedure

Standardizing the layout

To format the layout of your programs:

  1. Choose Utilities → Settings → ABAP Editor → Pretty Printer.
  2. On the Pretty Printer tab page, set the options you need, and confirm the settings. The following options are available:
    • Indent Statements: You can activate or deactivate the indentation of statements according to the rules of the Pretty Printer.
      • Insert Standard Comment: Comment blocks are inserted before FORM and MODULE statements without comments.
      • Do Not Insert Standard Comment: No comment blocks are inserted before FORM or MODULE statements without comment.
    • Uppercase/Lowercase: You can activate or deactivate the uppercase/lowercase conversion in the Pretty Printer.
      • Uppercase Display: All characters are converted to uppercase
      • Lowercase Display: All characters are converted to lowercase
      • Keywords in Uppercase: Only the ABAP keywords are converted to uppercase
      • Keywords in Lowercase: Only the ABAP keywords are converted to lowercase
      1. Press the Pretty Printer button.

Indenting blocks

Function In Front-End Editor (Plain Text Mode) In Back-End Editor

Indenting a block

Select the relevant lines and press Tab. The system indents the selected lines.

Position the cursor at the point where your indentation should start.

Choose  with the quick info text Indent line/block.

Repeat for each line you want to indent.

Removing the indentation for a block

Select the relevant lines and press Shift + Tab .

Same as above.

Result

When you save the changes, your ABAP source code is stored in the database with the layout produced by the Pretty Printer. When you open the program again you see get the same layout, regardless of the editor.