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).
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.
System will ask for date values as below.
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.
Hope this will help.
Thanks & Regards,