Wednesday, 26 June 2019

Selection Screen Variants – Part II

In my previous blog we discussed about types of variants, protection of variants and tables storing variant values and directory.

This blog will cover the details about the variant attributes and their usage.

Previous Blogs in the series:

Selection Screen Variants – Part I

Variant Attributes:


Once we enter values on the screen and click on save there are various attributes that we can select. Here we will look into the details with the help of an example.

We have a selection screen with three fields namely: Material (Parameter) , Date and Plant ( Select Options).

SAP ABAP Certifications, SAP ABAP Tutorials and Materials, SAP ABAP Certifications

On click of save button we are taken to the variant attributes screen:

SAP ABAP Certifications, SAP ABAP Tutorials and Materials, SAP ABAP Certifications

On this screen, you can define the attributes for the variant. Make sure that you enter a meaningful short text.

Only for background processing: If you select this option, the variant can only be used in background processing. You will not be able to start the program with this variant in dialog mode.

Protect variant: If you select this option, the variant can only be changed by the person who created it or the last person to change it.

Only display in catalog: If you select this option, the variant is not displayed in the input help list; it is only displayed in the catalog.

System variant: This option is set automatically, and cannot be changed.

Field Level Attributes:


Protect Field: If a user selects this field, then the field would not accept user input when the program is run using the variant.

Saving a variant with values as shown in below snapshot and making Material field as protected.

SAP ABAP Certifications, SAP ABAP Tutorials and Materials, SAP ABAP Certifications

Setting the Protect Field Flag for Material

SAP ABAP Certifications, SAP ABAP Tutorials and Materials, SAP ABAP Certifications

Execute the program with this variant ‘TEST’.

All the fields get filled with the saved value and material field becomes non-editable.

SAP ABAP Certifications, SAP ABAP Tutorials and Materials, SAP ABAP Certifications

◈ Hide field: Setting this parameter for a particular field hides the field when the variant is selected.
◈ Hide field ‘BIS’: Setting this parameter hides the select-option interval.
◈ Required Field: If this is set then the field becomes a mandatory field when the variant is used.
Using the same example as above:

Material : Field is set as protected and hidden.

Date: Hide Field ‘BIS’ is set.

Plant Field: Required is set.

SAP ABAP Certifications, SAP ABAP Tutorials and Materials, SAP ABAP Certifications

Execute the program using the variant:

As seen in below snapshot:

◈ Material field is hidden. (Can be viewed by clicking on ‘All Selections’ button )
◈ Interval for date field is hidden
◈ Plant field is made mandatory. (Can be checked by removing the filled in value. Tick sign will be present).

SAP ABAP Certifications, SAP ABAP Tutorials and Materials, SAP ABAP Certifications

On clicking the ‘All Selections’ button the material field can be viewed. Also when we remove the filled in value of plant we can see that it has been marked as a mandatory field.

SAP ABAP Certifications, SAP ABAP Tutorials and Materials, SAP ABAP Certifications

Next Blog: The next blog focuses on dynamic variants using Selection Variables.

No comments:

Post a Comment