Show TOC

Declaring Inline Variables ExplicitlyLocate this document in the navigation structure

In a method implementation, you can convert inline declarations of one or several local variables into explicit declarations.

Prerequisites

The local variable is declared inline using the statement addition DATA(temp).

This functionality is provided in SAP NetWeaver Release 7.40 SP05 and higher.

Context

Example

Before Execution After Execution

To copy the source code example, click here Code Example Before Execution

The inline declaration DATA(temp) is removed and an explicit declaration is inserted in the method implementation. In the corresponding method, the new local variables (temp and engine) are generated and replace the undeclared inline variable. The type (i and string) are derived from the usage of the variable.

Procedure

  1. In the implementation part, position the cursor on the inline declared variable.
  2. Get the quick assist proposals by choosing Quick Fix from the context menu (shortcut Ctrl 1) or by using the Quick Assist view.
  3. Apply Declare local variable 'variable' explicitly.