Show TOC

Formatting Source CodeLocate this document in the navigation structure

Use

You use this procedure to format your source code in the ABAP Editor.

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.
    • 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

  • Indenting a block:

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

  • Removing the indentation for a block

    Select the relevant lines and press Shift + Tab.

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.