How to create a Variant

In this post, we will discuss about Variant and how to create a variant.

A variant is a property provided by Sap to save the values of the selection screen, so the time and energy of the person will be saved who is executing the program again and again for multiple number of times. In some typical cases, there might be some hundreds of fields either parameters or select-options to be filled by the user. It might be difficult to remember all the field values. Variants are also useful when executing program through background mode in which system pull out the values into selection screen from variant.

Method 1: Enter T-code SE38 -> Enter your program name -> Click on Execute or F8

The selection screen looks like below

Image_29

Enter the values in the input fields (It’s not mandatory to fill all the input fields) and click on Save or CTRL+S to save the values into variant.

Once clicked on save, the below screen appears

Image_30

Give the Variant name and description and click on save. Once Variant is created, screen will be navigated back to selection screen

Note: I have discussed the options in the above screen in the later part of post.

Image_31

To use the variant, click on the icon “Get Variant” (marked on above image). So, all the variants which are created for this program will be listed in pop up window.

Image_32

Choose the required variant by clicking on it. The values will be placed in the input fields as below.

Image_33

 

Method 2: Enter T-code SE38 -> Enter your program name -> Click on Variants icon or CTRL+F1

Image_34

It will be navigated to below screen

Image_35

Here we can create a new variant, change the existing variant, rename the variant name, copy the variant and delete the variant from the options marked above.

 

Attributes of Variant:

Image_36

As discussed earlier, the variant name and description can be anything.

Only for Background Processing: This checkbox defines that the variant will be available only when we are running background job. It can’t be used while we run in foreground mode.

Protect Variant: This checkbox restricts the other user not to change the variant. For example, User A created a variant for a program. Suppose User B wants to change the same variant, it is not possible if this checkbox is checked.

Only display in Catalog: If this checkbox is checked, the variant won’t appear in the pop up window i.e., in the variant directory of that program.

Objects of Selection screen:

For all the objects in the selection screen we can set some properties through this variant individually.

Field name: These are the input fields on the selection screen(either from selection texts or from dictionary)

Technical name: These are the technical names of the above input fields respectively

Type: This defines whether it is parameter or select-options

P – Parameter

S – Select options

Protect field: If this protect field is checked, then that input field is grayed out i.e., it doesn’t allow to change the value.

Hide field: If this hide field is checked, then the input field is disappeared from the selection screen.

Hide field ‘BIS’: This option is only for select options. If this option is checked, then the select options turns into single input field instead of interval fields.

Save field without values: If this option is checked, the input fields will contain null values while importing any variant i.e., it won’t save values for those input fields into variant when this is checked.

Required field: If this option is checked, then it is mandatory to enter some value for that field. It won’t accept null value.

Leave a Reply