Show TOC

Declaring Variables from UsageLocate this document in the navigation structure

You can create an attribute, local variable, or a parameter (importing, returning, changing, or exporting) on the basis of a usage in a method implementation.

Prerequisites

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

Context

Example

Before Execution After Execution

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

The variable speed is used but not yet declared. In the signature of the drive method, the attributes (speed and engine_on) are added and declared.

Procedure

  1. In the implementation part, select the usage that you want to replace, for example, with a 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 Declare [importing / changing / exporting / returning] parameter from usage or Declare local variable from usage.