Using Mandatory Variables (SAP BW)

How to:

Mandatory variables are variables that are required in a procedure. If a mandatory variable is not satisfied, the procedure will not run. To satisfy a mandatory variable, you create selection (Where) criteria for it. Mandatory variables are identified in the field lists with one of the following icons.

Use the Where assist tool in Report Painter to create selection (Where) criteria for mandatory variables. Once a mandatory variable is satisfied, the icon changes.

You can use the variable itself or one of its DEFINE fields to create the selection criteria. The DEFINE fields are variable Caption and variable Name. Name is the technical name and Caption is the user-friendly name (description) for the variable. If you use the variable itself, it uses Caption and Name (concatenated with trailing blanks).

If you do not create selection criteria for a mandatory variable, you will not be able to get data values for other Where and/or When statements. Therefore, all mandatory variable selection criteria should be created first.

Note: When you create selection criteria for mandatory variables, this criteria is propagated to all other selection (Where) criteria statements and When statements you create. This means that when you retrieve values for other Where or When statements, the values that are returned are only those values that meet the selection criteria for the mandatory variable.

For more information on variables, see Viewing the Field Lists.

Top of page

Procedure: How to Create Selection Criteria for Mandatory Variables
  1. Click the Where/If button in the Report Painter toolbar. The Report Options dialog box opens, with the Where/If tab selected.
  2. Click Assist. The Expression Builder opens.
  3. Double-click the mandatory variable, or one of its DEFINE fields, to add it to the expression list. Notice that as soon as you add the mandatory variable to the list, the icon changes.
  4. Select the Logical Relation, the Compare Type, and the Compare Value.
  5. Repeat these steps for all mandatory variables.
  6. Click OK to exit the Expression Builder and OK to exit the Report Options dialog box.