Selecting a selection screen variant dynamically

By Ashesh Thodupunuri


This article will discuss in detail how to default a selection screen variant dynamically.

Often in real time scenarios we come across requirements to select the variant at runtime,

so the selection screen will be displayed with the selected variant.  


The selection screen variant should be defaulted automatically based on the user who has executed the report.  

First the users will design their variants according to their business requirement.

The user needs to create a variant with below naming convention:

U_XXXX (Where XXXX stands for user name).

If the user name is TEST123 then he should create a variant with name U_TEST123.  

Steps to be followed:  

Step1: Create program in SE38 with some meaningful description.  

Step2: Create a selection screen with two to three fields.

Create a selection screen variant with the naming convention as discussed above: U_TEST123( Where TEST123 is the user name in the system).  

As per the requirement we need to default the variant based on the user who is executing the report.  

Write the below code in the program in AT SELECTION SCREEN OUTPUT event.  

Call these function modules after the above concatenate statement.  


Login into the system with the User name TEST123 and execute the report then the selection screen variant U_TEST123 will be selected as default automatically.  

Summary: In this way users can default their variant which is frequently used by them, so this avoids them to select the same variant again and again. But only prerequisite is variant should be created for the first time with the above naming convention.

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 


Graphic Design by Round the Bend Wizards

footer image footer image