Overview: Variables

Variables allow you more flexibility in defining your forms and reports. Variables are report parameters which you do not want to specify until you define or execute the report. You can use different methods for replacing variables. Depending on how often you want to use them, you can define your variables globally or locally.

Global variables

If you use a variable frequently, you should define it globally. This makes it possible to use it in all your forms and reports.

The entries you need to make may differ depending on the variable type you choose. First, enter the variable type and a name according to the naming convention described below. When you then press ENTER , the system displays the fields you need to define. These fields include the replacement type, which determines how a value should be determined for the variable. After entering the replacement type, press ENTER again to receive additional fields. For information about these additional fields, see the online help by pressing F1 for those fields.

Note that when you change an existing global variable, this may affect a number of reports and forms which already use it.

You define global variables in Customizing. To create a new global variable, choose the pushbutton New entries. When you want to use a global variable in a form or report, you can display all the existing ones using the Possible entries function.

Local variables

If you want to create a variable which you only need in one particular form or report, you can create a local variable. Local variables are only known within the relevant form or report. If you define a local variable in a form, it is also valid for every report which uses that form. On the other hand, if you define a variable in the report definition, it is only valid for that one report.

The entries you need to make may differ depending on the variable type you choose. For information about the entry fields, see the online help by pressing F1 for those fields.

You maintain local variables when you define the form or report itself.

Variable types

There are currently four different variable types:

Replacement types

You are required to enter a replacement type when you define a variable. The replacement type determines how the variable should be replaced -- automatically by the system or by manual entry.

The following replacement types are available:

Online documentation exists for the field Replacement type as well as other fields available when you define variables.

Naming conventions

The following naming convention applies for variables:

However, if the symbol appears before a field for a variable, do not enter "&", since the system sets it automatically.

For information on how the different types of variables are used, see also Example: Use of Variables.