0% found this document useful (0 votes)
108 views

Dynamic Date Selection in Variants

This document discusses how to create screen variants in SAP for transactions like QA32 that allow for dynamic date selection. It explains that variants can be customized to populate fields like date ranges with specific default values using selection variables. Selection variables define what dynamic values like current date plus/minus a number of days will populate a field. Various operators can be used to specify single values, ranges, or search criteria. Overall, variants allow users to easily access screens pre-filled with desired date filters or other default filtering values.

Uploaded by

nstomar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
108 views

Dynamic Date Selection in Variants

This document discusses how to create screen variants in SAP for transactions like QA32 that allow for dynamic date selection. It explains that variants can be customized to populate fields like date ranges with specific default values using selection variables. Selection variables define what dynamic values like current date plus/minus a number of days will populate a field. Various operators can be used to specify single values, ranges, or search criteria. Overall, variants allow users to easily access screens pre-filled with desired date filters or other default filtering values.

Uploaded by

nstomar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Dynamic date selection in Variants

While answering one of the post related to screen variant creation/setup for SAP transactions, I thought of
preparing a small document on the same and sharing the same on forum. It might be possible that most of the
SAP guru’s knowing this function but this blog will be helpful to new comers in SAP… 🙂

So what’s it about… It’s about creating screen variants for SAP transactions with dynamic selections as desired.

Take an example of widely used QM transaction-QA32.

Above QA32 screen has a field-Lot Created On, with a date range already populated on initial screen. So how
these dates are appearing? And can I set my own date range here? Can I have any other fixed value on the same
screen e.g. Plant ? Number of questions can come up in mind…

To answer, yes, a respective user can set his/her own variant with specific values. I’m planning to explain it
below, with few screenshots.

On Tcode-QA32 screen, click on ‘SAVE’. System will display an existing variant as below, showing a variable set
for a particular field, if any.

Put your own Variant Name along with meaning.


As seen on above screen there are few functions available as SAP standard in variant attributes. E.g.

– Only for Background Processing: If you select the field Background only, the variant can only be executed in the
background. Otherwise, it can be run both in the background and online.

– Protect Variant: If you select this field, the variant can only be changed by the person who created it or last
changed it.

Based on requirement one can select/deselect it.

Search for the field on which a dynamic/variable date needs to be setup. Go to column-Type of selection variable
(Third from right hand side) and click on the dropdown icon or press F4 to show the popup menu for the
selection variable.

Double-click on the line “D” for dynamic date calculation. Selecting ‘type of variable’ is nothing but we are
declaring the field which need dynamic date calculation.

To mention a dynamic value, we need to select a Variable. Click on the dropdown icon or press F4 on column-
Name of variable to show available selection variables.
You need to select a sign field which allows to enter either “I” or “E”.

 “I” (Inclusive) means that the single value or range you specified is selected itself.
 “E” (Exclusive) means that the single value or range you specified is excluded from the selection.

The default is “I”.

Along with the sign field, need to select ‘Option’. With the operators in this field, you specify whether the entered
values are to be used as a single value, range, or search string for limiting data selection. Possible operators are:
EQ- Equal: Single Value, NE- Not Equal: Everything Apart from the Specified Single Value, LE- Less or EQUAL:
Everything <= Value in Field LOW, GT- Greater Than: Everything > Value in Field LOW, GE- Greater or Equal:
Everything >= Value in Field LOW and LT-Less Than: Everything < Value in Field LOW.

Once you fill in selection variables on screen, click on ‘SAVE’.

On transaction selection screen, click on tab-Get Variant (Shift+F5) and select your own variant. Depending upon
selection variables, system will populate a particular field with required values (as below).
Similarly, you can even choose other operators and check
effect. 

I chose option operator as ‘Less Than’ and variable as ‘Current Date +/- ??? days’. System will come up with a
pop-up window and ask value for days.
Put value with sign ‘-‘ in order to have date in past from current date whereas sign ‘+’ for future date.

Click on ‘SAVE’ & go back. Select your Variant to check.


In addition to above, we can chose a variable to set a date range. For the same, choose Variable name: Current
date – xxx, current date + yyy.

System will ask for date values as below.

Press Enter.
Click on save and go back (F3). Select your variant.

And you will see dates as per Variable selected (shown below).

Similar way, one can try different options of variables.

Along with it, just by adding field values on initial screen and saving the variant, system will put some fixed
values. E.g. one can have his/her Plant as fixed value in his/her variant.

You might also like