Show TOC

Assigning a Statement to a New VariableLocate this document in the navigation structure

You can create an attribute or local variable in order to assign the result of a functional method call. A functional method provides a returning parameter.

Prerequisites

This quick assist is provided if the statement has a result.

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 new variable car is to be added to replace the call of the create method

In the implementation part of the test method, the new car variable is declared.

At the cursor position, the new variable is added and assigned to the existing statement. Now, you can, for example, change its name

Procedure

  1. In the implementation part, position the cursor in front of the functional method call for which you want to create a new variable or attribute.
  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 Assign statement to new local variable or Assign statement to new attribute.