Beruflich Dokumente
Kultur Dokumente
Products
Products Industries
Industries Services and Support
Services Support Training
Training Community
Community Developer
Developer
Partner
Partner About
About
Ask a Question Write a Blog Post Login
Anup Patil
July 24, 2012 4 minute read
Dear All,
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.
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 1/24
3/7/2019 Dynamic date selection in Variants | SAP Blogs
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.
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 2/24
3/7/2019 Dynamic date selection in Variants | SAP Blogs
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.
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.
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 3/24
3/7/2019 Dynamic date selection in Variants | SAP Blogs
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.
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 4/24
3/7/2019 Dynamic date selection in Variants | SAP Blogs
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.
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 5/24
3/7/2019 Dynamic date selection in Variants | SAP Blogs
Put value with sign ‘-‘ in order to have date in past from current date whereas sign ‘+’ for future date.
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.
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 6/24
3/7/2019 Dynamic date selection in Variants | SAP Blogs
Press Enter.
And you will see dates as per Variable selected (shown below).
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 7/24
3/7/2019 Dynamic date selection in Variants | SAP Blogs
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.
Anup
Alert Moderator
Assigned tags
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 8/24
3/7/2019 Dynamic date selection in Variants | SAP Blogs
Related Questions
Logical database ADA, only table ANLAV elds appearing in Dynamic selection criteria
By Kimmo Sirpoma , Oct 16, 2018
Compound Journal Entries G/L Account Line Item Display
By Jamie Pedro , Jun 21, 2019
46 Comments
Like (1)
Former Member
Like (0)
Andrea Fuschetto
I’m changing my Planning area in both DP and SNP from 2 years to 5 years in monthly buckets. I need to
release my forecast from DP into SNP for all buckets. In the variant, I see the choice for “Current day +/-
days”. When I try to enter any value over 1000 days, I get an error saying it can’t accept it (too long).
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 9/24
3/7/2019 Dynamic date selection in Variants | SAP Blogs
It appears that only 3 characters are accepted, so 999 is my limit. But this is only 33 months instead of 60
months.
Do you know how I can get an option to enter “Current month +/- months”? Then I could say “60 months”
Thanks.
Andrea
Like (0)
Thomas Zloch
Thomas
Like (0)
Andrea Fuschetto
I wish I had that option. In APO (mc90 and also in lcout), these are my choices. (I’m selecting from Current
Date row, which is about 7 or 8 down in the list):
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 10/24
3/7/2019 Dynamic date selection in Variants | SAP Blogs
Current Date
Do you know how I can get the “Beginning of mth-xx-months, end of mth+yy months” option to show? That
would be perfect and exactly what I need.
Thanks.
Andrea
Like (0)
Thomas Zloch
I have SAP_BASIS 700 to 731 systems here, and all have the option I quoted above. What is your SAP_BASIS
level?
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 11/24
3/7/2019 Dynamic date selection in Variants | SAP Blogs
I once had the idea to enhance this function module to include a new option at the end (driven by a new Z-
function module that would contain the calculation logic), but enhancements there are forbidden by SAP with
a hint to “central basis” component.
Thomas
Like (0)
Andrea Fuschetto
I’m going to post in an APO forum and see what suggestions I get.
Andrea
Like (0)
Jason Duncan
Like (0)
But still you can go-in and change/overwrite your existing variants in SAP.
Thanks again.
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 12/24
3/7/2019 Dynamic date selection in Variants | SAP Blogs
Like (0)
Former Member
How do I get all the dynamic date variables. For instance, I do not have any that say “quarter”. I only have
these:
Current Date
Like (0)
Jeevan Sagar
Like (0)
Former Member
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 13/24
3/7/2019 Dynamic date selection in Variants | SAP Blogs
Like (0)
Sven Ringling
I happened upon this post only now, but maybe it’s still interesting for you:
if you need any additional variables, you can de ne them yourself in table TVARVC.
I the popup “choose selection variables” shown above you select T rather than D to access those variables.
However, you now need to take care of them being updated yourself. Could be manually in transaction
STVARVC or SM31, but usually you’d have a custom ABAP running in Batch every night (or whatever frequency
is needed) to update the values.
In older versions (R/3 4.5, if I remember correctly, not sure about APO), it was TVARV rather than TVARVC.
The old table was not client dependant.
Like (0)
Former Member
Like (0)
Pawan Kesari
Like (0)
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 14/24
3/7/2019 Dynamic date selection in Variants | SAP Blogs
Samy Magdy
Like (0)
Thanga Prakash
Like (0)
Thomas Zloch
Thomas
Like (0)
Thanga Prakash
My requirement is like FROM should be the initial date and TO should be current date – 365 days like.
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 15/24
3/7/2019 Dynamic date selection in Variants | SAP Blogs
Like (0)
Thomas Zloch
Thomas
Like (0)
Former Member
This is so that on a Monday, document postings from Friday to Sunday are picked up. Does anyone know if this
is possible via SQ02 if not in the variant?
Thanks
Like (0)
Narayana N
Regards,
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 16/24
3/7/2019 Dynamic date selection in Variants | SAP Blogs
Narayan N
Like (0)
Former Member
Like (0)
Former Member
Like (0)
Former Member
Like (0)
Former Member
Like (0)
Poonam Chawla
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 17/24
3/7/2019 Dynamic date selection in Variants | SAP Blogs
I have a requirement for date range where the rst date is xed (01/23/2013) and last date is current date
which varies depending on sy-datum.
Which option will help me to get this resolved.is it possible with dynamic selection screen?
Kindly reply.
Like (0)
You can simply put in date value as ‘greater than or equal to 01/23/2013 (your xed date)’ in date eld and I
think it should work.
So whenever you run your report/program, system will take documents from that date (01/23/2013) to
current date on which you’re executing it.
Hope it helps.
Thanks.
Kind Regards,
Anup
Like (0)
Poonam Chawla
Like (0)
Kashi Yadaram
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 18/24
3/7/2019 Dynamic date selection in Variants | SAP Blogs
Kashi
Like (0)
Former Member
Like (0)
Former Member
My requirement is to select the variant “Current date + 0 , Current date + 50” in working days but when i
select the variant Date – xxx, Date + yyy(work days), it doesn’t work.
Thanks,
Shashank
Like (0)
I’ve given printscreen of the requirement same as yours & de nitely it would work.
Could you please check again in my blog about this & try?
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 19/24
3/7/2019 Dynamic date selection in Variants | SAP Blogs
Thanks.
Like (0)
John McKee
However, I would like to know how we can use this with the updated data browser SE16N?
I have a requirement to run an extract for some HR data from table PA0001.
I want to extract all records where End Date is greater than the current date -1 and Start Date is less than
Current date +1, e ectively status as at today, eg ENDDA > 09.07.2015 and BEGDA <11.07.2015 meaning status
as at 10.07.2015 – but to have this update dynamically at run time.
I know how to do this in SE16 and save as a variant using Dynamic Date Calculation.
But how do you do this with and SE16N variant and schedule with SE16N_BATCH. I can’t nd where to store
these parameters with SE16N?
John McKee
Like (0)
Thanks for your comments above. Also to mention, I never tried this function in SE16N but shall check.
Thanks.
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 20/24
3/7/2019 Dynamic date selection in Variants | SAP Blogs
Like (0)
Former Member
Like (1)
Former Member
Like (1)
Timothy Bondy
Like (1)
Former Member
I use a ZZ T-code which provide me a list with Purchase Orders, then I created a Variant to display only the last
working day PO’s created, and it is working well as your guidance above.
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 21/24
3/7/2019 Dynamic date selection in Variants | SAP Blogs
The problem appeared when I created a daily basis Job on SM36, to run this Variant with the dynamic date, the
result list of the Job display always the same day as the Job creation date, instead of getting updated after the
days past by.
Best regards
Like (0)
Former Member
What if we want these dates in “Exclude” selection column? How can we do that?
Thanks,
Like (0)
Former Member
Like (0)
Subhadeep Kar
Like (1)
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 22/24
3/7/2019 Dynamic date selection in Variants | SAP Blogs
karan kothari
I am having requirement to create screen variant for a transaction that is executed based on scal year
parameter. I want to make it dynamic.
For eg. if I run the transaction today then it should executed for current scal year “-2”.
Thanks
Karan
Like (0)
Former Member
Like (1)
Former Member
Like (1)
Former Member
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 23/24
3/7/2019 Dynamic date selection in Variants | SAP Blogs
Sitemap Newsletter
https://blogs.sap.com/2012/07/24/dynamic-date-selection-in-variants/ 24/24