Show TOC

Converting Local Variables to ParametersLocate this document in the navigation structure

You can convert a local variable into a parameter create one of the following parameter types: IMPORTING, RETURNING, CHANGING, or EXPORTING.

Prerequisites

This functionality is provided in SAP NetWeaver Release 7.31 SP11 and higher as well as Release 7.40 SP05 and higher.

Context

Example

Before Execution After Execution

To copy the source code example, click hereCode Example Before Execution

The local variable speed is declared inside the drive method. The local declaration has been removed and the speed parameter has been added to the signature of the drive method.

Procedure

  1. In the source code editor, navigate to the method and position the cursor on the definition of the local 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 Convert 'local variable' to [importing / changing / exporting / returning] parameter.