Show TOC

 Variant MaintenanceLocate this document in the navigation structure

Purpose

Variant maintenance allow you to save sets of input values for programs that you often start with the same selections. You can use them for any programs except subroutine pools (type S).

Whenever you start a program in which selection screens are defined, the system displays a set of input fields for database-specific and program-specific selections. To select a certain set of data, you enter an appropriate range of values.

For more information about selection screens, see Selection Screens in the ABAP User's Guide.

If you frequently run the same program with the same set of selections (for example, to create a monthly statistical report), you can save the values in a selection set called a variant.

Note

You can create any number of variants for any program in which selection screens are defined. Variants are assigned exclusively to the program for which they were created.

You can also use variants to change the appearance of the selection screen by hiding selection criteria. This is useful when you are working with large selection screens on which not all of the fields are relevant.

Note

It is possible to create a variant for more than one selection screen. This function is useful for reports, module pools, and function groups that have several selection screens.

Features

Variants are an interface between the user and the selection screen. They can be used both in dialog and in background mode, although their uses are slightly different.

Variants in Dialog Mode

In dialog mode, variants make things easier for the user, since they save him or her from continually having to enter identical values. They can also make the selection screen easier to read, because you can use them to hide input fields. Running an executable program with a variant containing an optimal set of values also reduces the capacity for user error. The optimized database selections speed up the runtime of the program.

Variants in Background Mode

Variants are the only method for passing values to a report program in a background job. When you run a program in the background, you must use a variant (or SUBMIT... VIA JOB). ABAP contains a mechanism allowing you to pass variable values to variants. Thus you avoid creating a new variant each time you run the report. For more information, see Variable Values in Variants.

To ensure that an executable program is always started using a variant, you can specify in the program attributes that the program can only be started in this way.

The following functionality is possible for variants:

  • Creation of variants
  • Display, change, copy, print, and delete variants
  • Use and definition of variables in variants
    • Variable date calculation
    • User-specific fixed values
    • Fixed values in table TVARVC