dynamic date selection in variants

Upload: chandargupta

Post on 07-Jul-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/18/2019 Dynamic Date Selection in Variants

    1/15

    Generated by Jive on 2016-03-28+02:001

    Enterprise Resource Planning (SAP ERP):Dynamic date selection in Variants

    Posted by An up Patil Jul 24, 2012 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. Take an example of widely used QM transaction-QA32.

    http://scn.sap.com/servlet/JiveServlet/showImage/38-69663-122599/1.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/38-69663-122599/1.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/38-69663-122599/1.JPGhttp://scn.sap.com/people/anup.patil3

  • 8/18/2019 Dynamic Date Selection in Variants

    2/15

    Enterprise Resource Planning (SAP ERP): Dynamic date selection in Variants

    Generated by Jive on 2016-03-28+02:002

    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 variableset 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 inthe 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 lastchanged 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 selectionvariable (Third from right hand side) and click on the dropdown icon or press F4 to show the popup menu forthe selection variable.

  • 8/18/2019 Dynamic Date Selection in Variants

    3/15

    Enterprise Resource Planning (SAP ERP): Dynamic date selection in Variants

    Generated by Jive on 2016-03-28+02:003

    Double-click on the line “D” for dynamic date calculation. Selecting 'type of variable' is nothing

    but we are d eclaring 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".

    http://scn.sap.com/servlet/JiveServlet/showImage/38-69663-122727/5.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/38-69663-122727/5.JPG

  • 8/18/2019 Dynamic Date Selection in Variants

    4/15

    Enterprise Resource Planning (SAP ERP): Dynamic date selection in Variants

    Generated by Jive on 2016-03-28+02:004

    Along with the sign field, need to select 'Option'. With the operators in this field, you specify whether theentered values are to be used as a single value, range, or search string for limiting data selection. Possibleoperators are: EQ- Equal: Single Value, NE- Not Equal: Everything Apart from the Specified Single Value, LE-Less or EQUAL: 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. Dependingupon selection variables, system will populate a particular field with required values (as below).

    Similarly, you can even choose other operators and check effect.

  • 8/18/2019 Dynamic Date Selection in Variants

    5/15

    Enterprise Resource Planning (SAP ERP): Dynamic date selection in Variants

    Generated by Jive on 2016-03-28+02:005

    I chose option operator as 'Less Than' and variable as 'Current Date +/- ??? days'. System will come up with apop-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.

  • 8/18/2019 Dynamic Date Selection in Variants

    6/15

    Enterprise Resource Planning (SAP ERP): Dynamic date selection in Variants

    Generated by Jive on 2016-03-28+02:006

    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.

  • 8/18/2019 Dynamic Date Selection in Variants

    7/15

    Enterprise Resource Planning (SAP ERP): Dynamic date selection in Variants

    Generated by Jive on 2016-03-28+02:007

    System will ask for date values as below.

    Press Enter.

  • 8/18/2019 Dynamic Date Selection in Variants

    8/15

    Enterprise Resource Planning (SAP ERP): Dynamic date selection in Variants

    Generated by Jive on 2016-03-28+02:008

    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 fixedvalues. E.g. one can have his/her Plant as fixed value in his/her variant. Hope this will help. Thanks & Regards,Anup

    48658 Views Tags: screen_variants

    Ananth ThiruvengadamFeb 19, 2016 10:52 AMVery Useful

    Anup Patil in response to John McKee on page 9

    http://scn.sap.com/people/anup.patil3http://scn.sap.com/people/anup.patil3http://scn.sap.com/people/ananth.thiruvengadamhttp://scn.sap.com/people/ananth.thiruvengadamhttp://scn.sap.com/community/erp/blog/tags#/?tags=screen_variants

  • 8/18/2019 Dynamic Date Selection in Variants

    9/15

    Enterprise Resource Planning (SAP ERP): Dynamic date selection in Variants

    Generated by Jive on 2016-03-28+02:009

    Sep 25, 2015 4:45 PMHi John,Thanks for your comments above. Also to mention, I never tried this function in SE16N but shall check.Thanks.

    Swati KaushalJul 16, 2015 2:14 PMReally good stuff.. thanks

    John McKeeJul 10, 2015 7:21 AMHiThis is excellent material here.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 thanCurrent date +1, effectively status as at today, eg ENDDA > 09.07.2015 and BEGDA

  • 8/18/2019 Dynamic Date Selection in Variants

    10/15

    Enterprise Resource Planning (SAP ERP): Dynamic date selection in Variants

    Generated by Jive on 2016-03-28+02:0010

    My requirement is to select the variant "Current date + 0 , Current date + 50" in working days but when iselect the variant Date - xxx, Date + yyy(work days), it doesn't work.Could anyone help or give any suggestion regarding this? Thanks,

    Shashank

    Jimmy Dahl PedersenNov 19, 2014 2:18 PMExactly what I needed Thank you :-)

    Anup Patil in response to Poonam Chawla on page 10 Nov 8, 2014 1 0:48 PMHi Poonam,You can simply put in date value as 'greater than or equal to 01/23/2013 (your fixed date)' in date field and Ithink it should work.

    So whenever you run your report/program, system will take documents from that date (01/23/2013) to currentdate on which you're executing it. Hope it helps.Thanks. Kind Regards,Anup

    Kashi Yad aramOct 9, 2014 10:55 PM

    Excellent...wish I know this before. Kashi

    Poonam ChawlaOct 9, 2014 8:28 PMHi,I have a requirement for date range where the first date is fixed (01/23/2013) and last date is current datewhich varies depending on sy-datum.Which option will help me to get this resolved.is it possible with dynamic selection screen?Kindly reply.

    Mary MillironSep 9, 2014 7 :55 PMThank you. Learned something new today.

    sreehari tokalaAug 6, 2014 1 2:33 PMnice document but i need Segment field where i can get his field.

    http://scn.sap.com/people/sreeharli.tokalahttp://scn.sap.com/people/mary.millironhttp://scn.sap.com/people/kashi.yadaram2http://scn.sap.com/people/anup.patil3http://scn.sap.com/people/jimmydahlpedersensehttp://scn.sap.com/people/sreeharli.tokalahttp://scn.sap.com/people/sreeharli.tokalahttp://scn.sap.com/people/mary.millironhttp://scn.sap.com/people/mary.millironhttp://scn.sap.com/people/poonam.chawlahttp://scn.sap.com/people/poonam.chawlahttp://scn.sap.com/people/kashi.yadaram2http://scn.sap.com/people/kashi.yadaram2http://scn.sap.com/people/anup.patil3http://scn.sap.com/people/anup.patil3http://scn.sap.com/people/jimmydahlpedersensehttp://scn.sap.com/people/jimmydahlpedersense

  • 8/18/2019 Dynamic Date Selection in Variants

    11/15

    Enterprise Resource Planning (SAP ERP): Dynamic date selection in Variants

    Generated by Jive on 2016-03-28+02:0011

    Andrea Fuschetto in response to Thomas Zloch on page 11Jul 9, 2014 4:15 PMThey must have used different programmers for APO because it is very different than ECC. I see tons of otherchoices in ECC, but only the ones I listed above in APO.

    I'm going to post in an APO forum and see what suggestions I get. Thanks for the response, though.Andrea

    Daniel LippmannJul 9, 2014 4:05 PMI knew about this before, but it's great to have it written down. Great post!

    Thomas Zloch in response to Andrea Fuschetto on page 11Jul 9, 2014 3:57 PM

    I don't know in what way APO is special in this regard. For "normal" selection variants there is a functionmodule RS_VARI_V_INIT which collects the available options for dynamic date calculation. I have SAP_BASIS 700 to 731 systems here, and all have the option I quoted above. What is your SAP_BASISlevel? 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 ahint to "central basis" component.

    Thomas

    Andrea Fuschetto in response to Thomas Zloch on page 12 Jul 9, 2014 3:34 PMHi Thomas: I wish I had that option. In APO (mc90 and also in lcout), these are my choices. (I'm selecting from CurrentDate row, which is about 7 or 8 down in the list): Current DateCurrent date +/- ??? days

    current date +/- ??? work daysFirst day of current monthnth working day of current monthFirst day of next monthFirst day of previous monthLast day of previous monthLast Day of the Current Month

    http://scn.sap.com/people/andrea.fuschettohttp://scn.sap.com/people/andrea.fuschettohttp://scn.sap.com/people/thomas.zlochhttp://scn.sap.com/people/thomas.zlochhttp://scn.sap.com/people/lippmann.danielhttp://scn.sap.com/people/lippmann.danielhttp://scn.sap.com/people/andrea.fuschettohttp://scn.sap.com/people/andrea.fuschetto

  • 8/18/2019 Dynamic Date Selection in Variants

    12/15

    Enterprise Resource Planning (SAP ERP): Dynamic date selection in Variants

    Generated by Jive on 2016-03-28+02:0012

    Do you know how I can get the "Beginning of mth-xx-months, end of mth+yy months" option to show? Thatwould be perfect and exactly what I need. Thanks.

    Andrea

    Thomas Zloch in response to Andrea Fuschetto on page 12 Jul 9, 2014 9:12 AMAt the bottom of the choices f or dynamic date calculation, I can see "(Beginning of mth-xx months, end of mth+yy months)" Try this for your scenario.

    Thomas

    Andrea Fuschetto in response to Anup Patil on page 15 Jul 8, 2014 5:35 PMHello Anup: I'm changing my Planning area in both DP and SNP from 2 years to 5 years in monthly buckets. I need torelease 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).

    Entry too long (enter in the format __~V) It appears that only 3 characters are accepted, so 999 is my limit. But this is only 33 months instead of 60months. Do you know how I can get an option to enter "Current month +/- months"? Then I could say "60 months" I'm using /n/sapapo/mc90 to release the fcst from DP to SNP. Thanks.Andrea

    Douglas LinJun 19, 2014 4:31 AMThanks Anup , this is really helping me to understand the dynamic data .

    Narayana NApr 19, 2014 8:13 PMDear Anup,

    http://scn.sap.com/people/narayana.n3http://scn.sap.com/people/narayana.n3http://scn.sap.com/people/narayana.n3http://scn.sap.com/people/douglas.lin2http://scn.sap.com/people/douglas.lin2http://scn.sap.com/people/andrea.fuschettohttp://scn.sap.com/people/andrea.fuschettohttp://scn.sap.com/people/thomas.zlochhttp://scn.sap.com/people/thomas.zloch

  • 8/18/2019 Dynamic Date Selection in Variants

    13/15

    Enterprise Resource Planning (SAP ERP): Dynamic date selection in Variants

    Generated by Jive on 2016-03-28+02:0013

    Good effort keep it up

    Regards,Narayan N

    Dave ThomasApr 15, 2014 11:35 AMThanks, great post. I have a report which requires a date range including a working day and a non-workingday. I need the 'date from' to be working day - 1 and the 'date to' being yesterday. This is so that on a Monday, document postings from Friday to Sunday are picked up. Does anyone know ifthis is possible via SQ02 if not in the variant? Thanks

    Thomas Zloch in response to Thanga Prakash on page 13 Mar 19, 2014 2:22 PMBut this means you want everything up to 19.03.2013. You can set "LE" (less or equal) as "option" for thedynamic date variant "current d ate +/- ??? day s" and that should do it.

    Thomas

    Thanga Prakash in response to Thomas Zloch on page 13 Mar 19, 2014 2:04 PMIf I do like that I will end up like below. Created on 19.03.2013 TO .

    My requirement is like FROM should be the initial date and TO should be current date - 365 days like. Created on TO 19.03.2013.

    Thomas Zloch in response to Thanga Prakash on page 13 Mar 19, 2014 1:50 PMYou would rather do it like "Date LE " using only the FROM date. Thomas

    Thanga PrakashMar 19, 2014 1:41 PMHow can I create a dynamic variant for date only in TO, like below. Date TO

    Sven Ringling in response to Ken Snyder on page 14 Jul 28, 2013 11:37 PM

    http://scn.sap.com/people/thomas.zlochhttp://scn.sap.com/people/sven.ringlinghttp://scn.sap.com/people/sven.ringlinghttp://scn.sap.com/people/thanga.prakashhttp://scn.sap.com/people/thanga.prakashhttp://scn.sap.com/people/thomas.zlochhttp://scn.sap.com/people/thomas.zlochhttp://scn.sap.com/people/thanga.prakashhttp://scn.sap.com/people/thanga.prakashhttp://scn.sap.com/people/thomas.zlochhttp://scn.sap.com/people/thomas.zlochhttp://scn.sap.com/people/benwarhttp://scn.sap.com/people/benwar

  • 8/18/2019 Dynamic Date Selection in Variants

    14/15

    Enterprise Resource Planning (SAP ERP): Dynamic date selection in Variants

    Generated by Jive on 2016-03-28+02:0014

    Hi Ken, I happened upon this post only now, but maybe it's still interesting for you:if you need any additional variables, you can define 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 transactionSTVARVC or SM31, but usually you'd have a custom ABAP running in Batch every night (or whateverfrequency 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.

    Samy MagdyJun 26, 2013 12:33 PMNice one.

    Pawan Kesari

    Jun 21, 2013 3:08 PMGood document.

    Subrahmanyam BJun 21, 2013 2:36 PMDear,

    Very informative !!

    Ken SnyderOct 18, 2012 12:06 AMActually its in APO. But I am asking how to create new ones in general. What if I wanted a new dynamic

    variable for end of the year. I know I can use TVARV variables. But is it possible to create new dynamic datevariables.

    Jeevan Sagar in response to Ken Snyder on page 14 Oct 17, 2012 11:36 PMWhat version of SAP are you on?

    Ken SnyderOct 17, 2012 9:42 PMHow do I get all the dynamic date variables. For instance, I do not have any that say "quarter". I only havethese:

    Current DateCurrent date +/- ??? dayscurrent date +/- ??? work daysFirst day of current monthnth working day of current monthFirst day of next monthFirst day of previous month

    http://scn.sap.com/people/samy.magdyhttp://scn.sap.com/people/kenneth_snyderhttp://scn.sap.com/people/kenneth_snyderhttp://scn.sap.com/people/sjeevanhttp://scn.sap.com/people/sjeevanhttp://scn.sap.com/people/kenneth_snyderhttp://scn.sap.com/people/kenneth_snyderhttp://scn.sap.com/people/praveen.b4http://scn.sap.com/people/praveen.b4http://scn.sap.com/people/pawan.kesari2http://scn.sap.com/people/pawan.kesari2http://scn.sap.com/people/samy.magdyhttp://scn.sap.com/people/samy.magdy

  • 8/18/2019 Dynamic Date Selection in Variants

    15/15

    Enterprise Resource Planning (SAP ERP): Dynamic date selection in Variants

    Generated by Jive on 2016-03-28+02:00

    Last day of previous monthLast Day of the Current Month

    Anup Patil in response to Jason Duncan on page 15 Jul 28, 2012 4:38 PMThanks Jason for your appreciation and apologies for posting this a bit late... :-)But still you can go-in and change/overwrite your existing variants in SAP.Thanks again.

    Jason DuncanJul 28, 2012 2:50 AMGreat post here. I wish I had this the first time I had to setup a variant. It would have made it much easier.

    Amit Talekar in response to Anup Patil on page 15 Jul 27, 2012 2:11 PM

    Good job

    Anup PatilJul 27, 2012 12:55 PMForgot to mention but comments will be appreciated... Thanks.

    http://scn.sap.com/people/anup.patil3http://scn.sap.com/people/anup.patil3http://scn.sap.com/people/artalekarhttp://scn.sap.com/people/artalekarhttp://scn.sap.com/people/jmduncanhttp://scn.sap.com/people/jmduncanhttp://scn.sap.com/people/anup.patil3http://scn.sap.com/people/anup.patil3