Dynamic date selection in variants

Dear Experts ,
I require to make the dynamic selection for a date range in a particular report as under :
From Date : Current date - 90 days
To date : Current date - 60  days
How can i achieve this in the variant ?
Regards
Anis

this is an example on making a date field dynamic for transaction MICN, it is the same way for other transactions
Create a variant by saving your selection.
after clicking the save button, you are in the screen fro variant attributes.
enter variant name and desciption
Find the fields GIDAT and GBDAT.
If you plan to run it e.g. every monday. then the monday will be your start date GIDAT and the next Sunday your to-date GBDAT.
select GIDAT and find the column for selection variable, press F4 in that field and select D for dynamic selection.
Then find field name of variable, press F4 and select current date.
select GBDAT and find the column for selection variable, press F4 in that field and select D for dynamic selection.
Then find field name of variable, press F4 and select current date +x days. then enter 7 in the pop-up.

Similar Messages

  • BMBC Dynamic Date selection Variant

    Hello Team,
    I want to create variant in BMBC -Batch Information Cockpit with Dynamic Date Selection. But it do not find the screen the to set-up variant attributes
    This is the field where I want to have dynamic date selection, 1st Day of the month to Last day of the month.
    Field name and program
    I am using SE80
    As you can see screen number 0100 is not showing up. and I have gone though all available screen but i could not find the field.
    Please advise if dynamic date selection for this field is possible at all or there is other way.
    Thanks

    I don't think that it is possible to have dynamic date selection here. The whole selection screen is just dynamic, it has only place holders and you define in customizing which field is on the selection screen.
    You actually save a selection variant via this extra big button for selection variants, which is quite different to the disc icon where you usually save your selection variants and where  you have the option to define dynamic date fields.

  • Program to regenerate user variants for dynamic date selection!

    Hello all:
           We upgraded to ECC6.0 from 4.6C and there are some variants that user created in 4.6C in which they set dates like date = date - 1day something like that (basically dynamic date selection). These variants are not working in ECC6.0 unless the user clicks on the variant button and resaves it!! Does anyone know if there is any SAP program  that I can run that does this automatically? Rewards assured.
    Thanks.
    Mithun

    Thanks for the reply Rob. We already ran RSVARDOC_610! Is there any specific program just for the issue I am having?
    Thanks.
    Mithun

  • Dynamic Date selection inactive

    Hi,
    I am not able to give dynamic date selection in a variant. (D: Dynamic date calculation).The traffic light is displayed in red and there is no options such as
    current date etc. is there any need to do some settings to get these options.

    Hi,
    have a look at the below link..  ( they have mentioned the steps of customer exit variable fassigning for reporting agent)
    https://websmp110.sap-ag.de/~form/sapnet?_FRAME=CONTAINER&_OBJECT=011000358700003598422003E
    Regards,
    Siva.

  • Activating dynamic date calculation in variant

    Per the link below, I used to be able to activate "dynamic date calculation" in variant.
    <link to blocked site removed by moderator>
    Our system has been upgraded to 6.0 and now we do not the same variant attribues screen where I can activate the "D" variable.  It brings me to program/screen SA38/281. 
    Any suggestion how I may activate the "D" dynamic date calculation variable in a variant?
    Edited by: Thomas Zloch on Oct 14, 2011 11:34 AM

    Actually I meant the relevant code of your custom report, you just provided me with the info of the standard variant screen.
    You can go to SE38, enter your custom report name, display the code, and paste the definition of that parameter. (It would be something like
    PARAMETERS: P_DATEHG TYPE XXX_TYPE.
    What I am interested in is to know which data type is being used, since this functionaliy will only apply to date type fields. So, bottom line: this field must definitely be a date, which makes me think that either something has changed in the custom report or after the upgrade to ECC 6.0 this data type might have changed as well.
    Best regards.
    Edited by: Jose Maria Otero on Oct 14, 2011 5:26 PM

  • Dynamic Date calculation in Variants

    Dear SAP Guru's,
    I am creating variant for Planning Run by maintaining the . I n this, I want to select the horizon as from 1st day of next month and to date as last day of next month. But I am not finding the Last day os next Month in the F4 list.
    Please any one explain me the way of creating the "Last day of Next month".
    The available list is like below..
    Current Date
    Current date +/- ??? days
    current date +/- ??? work days
    First day of current month
    nth working day of current month
    First day of next month
    First day of previous month
    Last day of previous month
    Last Day of the Current Month
    How can I create, one more like 'Last day of Next month'?
    Regards,
    Sree

    In the dynamic date period selection options there is also an option for " (Beginning of mth-xx months, end of mth+yy months)"  You can double-click on this line and enter in a value for xx and yy.  If you enter "1" in for the yy value, then the end of the range should be the end of the next calendar month.

  • Dyanamic Date Selection in variants

    Hi....
    In select-options i have declared one field for Posting Date.
    my requirement is
    in TO : Today - 1.
    based on that FROM : start of month date
    for that what i hv to change in variant.
    I hv select for date selection variable as D and
    Name of Variable :  what i hv to choose.
    or how can add my new formula in that.
    Regards,
    Arpit

    Hi Arpit,
    yes this is possible ... and this time i tried it out before i post..
    I used this little testreport:
    DATA: lt_range_date TYPE RANGE OF d,
          ls_range_date LIKE LINE OF lt_range_date.
    ls_range_date-sign   = 'E'.
    ls_range_date-option = 'BT'.
    ls_range_date-low    = '20071201'.
    ls_range_date-high   = '20071212'.
    APPEND ls_range_date TO lt_range_date.
    SUBMIT zdatetest  USING SELECTION-SET 'TEST'
                        WITH s_date       IN lt_range_date.
    It's calling a testreport zdatetest which has two parameters and a variant TEST.
    One parameter was set by the variante and the other for the date-selection was set from the lt_range_date.
    Stefan

  • Dynamically generating selection screen variants

    Hi,
    I have a report for which i have to create a variant. This report will be executed in background. There is a parameter Planning Date on the selection screen of this report. The format of this date is week.year i.e., ww.yyyy. Week should change automatically based on the week it is executed. For example, lets suppose that the current planning date is 19.2007. When you execute this report in the next week, the date should be 20.2007.
    Please suggest me on how to do this.
    Best Regards,
    Phani.

    Hi,
    Create two variants for the below program say VAR1 and VAR2.
    For the variant VAR1 take the default values say 12 and 3.
    and for VAR2 take the values 10 and 5.
    Now execute the program by selecting the variants VAR1 and VAR2. You can see the difference.
    when you select VAR1 the parameters can be seen in disable mode.
    parameters: p_num1 type i default 12,
                      p_num2 type i default 3.
    at selection-screen output.
    if sy-slset = 'VAR1'.
    loop at screen.
      if screen-name = 'P_NUM1' or
         screen-name = 'P_NUM2'.
         screen-input =  0.
      endif.
      modify screen.
    endloop.
    endif.
    write:/5 p_num1, 35 p_num2.
    Edited by: Velangini Showry Maria Kumar Bandanadham on Apr 14, 2008 12:52 PM

  • Dynamic data selection in process chain

    Dear BW gurus,
    I've an infocube 0PA_C01. I'm gettting data with data source 0HR_PA_0. Because of
    time-dependency of personel data i should get the package month by month. SO I set the data selection parameter 0CALMONTH in data package.  
    0CALMONTH=200601-200601;
    0CALMONTH=200602-200602;
    My question is how can i use this data package in a process chain for automatically getting data each month without manually changing data selection parameter.
    thanks,
    Yigit

    Hi Yigit,
    In the info-package after you have selected type '6' it will take you to the ABAP editor, please try the following code,
    data: l_s_range type rssdlrange,
            l_date type d.
    l_date = sy-datum.
    l_year = l_date+0(4).
    l_mth = l_date+4(2).
    concatenate l_year l_mth into l_month_high.
    concatenate l_year '01' into l_month_low.
    loop at l_t_range into l_s_range where fieldname = 'CALMONTH'.
    if dy-subrc = 0.
      l_s_range-low = l_month_low.
      l_s_range-low = l_month_high.
      modify l_t_range from l_s_range.
    endif.
    endloop.

  • BEX to allow for the dynamic date on a variant as is the case with ABAP

    Hi All,
    I have doubt that where we are able to use dynamic date for BEX date variable?
    In normal ABAP program,We have option to get dynamic date for date field parameters.Like that can we have dynamic date for BEX date variable.
    Please let me know.
    Thanks in advance for your help,
    Bandana.
    Edited by: Bandana Baghel on Jul 3, 2009 10:44 AM

    Hi Bandana,
    When you say dynamic date, are you refering to the system date on which the BEx query run?
    If so, there are SAP Exit variable available which can be used to retrieve system date at run time.
    Try using 0DAT variable which will return the system date at run time.
    Regards
    Amit Roy

  • Dynamic date selections in a variant

    Hi All,
    I need to dynamically change the date field of a report which runs every month end. Our working calendar is designed such that the last working day is the last Friday of the current period and hence the first working day is the last Saturday of the previous period. Now we have Fiscal Calendar variant which takes care of the last Friday part. I also know we have to select 'D' in the variant screen but my problem is in assigning the Last Saturday of the previous period in the date range field. Any hints or suggestions on this would be highly appreciated and of course rewarded generously.
    Thanks & Regards,
    Rajesh

    Hi Rajesh,
    After seecting Selection Variable "D" you have to carry out following things to cater your requirements;
    (a) Goto Name of Variable (input only using F4)
    (b) Select your variable depending upon your business requirement.
    Current Date
    From month start to today
    Current date +/- ??? days
    current date +/- ??? work days
    First day of current month
    <b>nth working day of current month</b>
    First day of next month
    First day of previous month
    Last day of previous month
    Last Day of the Current Month
    First quarter ????
    Second quarter ????
    Third quarter ????
    Fourth quarter ????
    Current date - xxx,current date + yyy
    Date - xxx, Date + yyy (work days)
    Previous month
    Current period
    (Beginning of mth-xx months, end of mth+yy months)
    I think nth working day of current month is suitable for your requirement.
    Bye,
    Muralidhara

  • Dynamic data select from table is giving dump

    Hello Experts,
       Below statement is giving Dump after it move all the data in my dynamic table.
    When i see in debug. All my recored are avilable in <T_TAB> Table.
    SELECT * FROM (pa_tab) INTO CORRESPONDING FIELDS OF TABLE <T_TAB>.
    > IF SY-SUBRC = 0.
    Information on where terminated
    The termination occurred in the ABAP program "ZFIR_ZTABLE_UPLOAD" in
    "F_DOWNLOAD".
    The main program was "ZFIR_ZTABLE_UPLOAD ".
    The termination occurred in line 403 of the source code of the (Include)
    program "ZFIR_ZTABLE_UPLOAD"
    of the source code of program "ZFIR_ZTABLE_UPLOAD" (when calling the editor
    4030).
    Processing was terminated because the exception "CX_SY_OPEN_SQL_DB" occurred in
    the
    procedure "F_DOWNLOAD" "(FORM)" but was not handled locally, not declared in
    the
    RAISING clause of the procedure.
    The procedure is in the program "ZFIR_ZTABLE_UPLOAD ". Its source code starts
    in line 399
    of the (Include) program "ZFIR_ZTABLE_UPLOAD ".
    please help me.
    Regards,
    Amit
    Message was edited by:
            Amit Gupta

    Hi Amit,
    Check if you are doing the following in your program
    FIELD-SYMBOLS <T_TAB> TYPE STANDARD TABLE.
    DATA: g_tabref type ref to data.   "Reference to your table structure
    CREATE DATA g_tabref type standard table of (pa_tab).
    ASSIGN g_tabref->* to <T_TAB>.
    SELECT * FROM (PA_TAB) INTO TABLE <T_TAB>.
    Hope this solves your problem.
    Let me know if you require any further info.
    Enjoy SAP. Reward points of useful
    Rajasekhar

  • Dynamic Data selection for the Filed entered in Selection Screen.

    Hi All,
    My requirement is as follows.
    1 select options in Selection Screen for MATNR (SO_MATNR)
    1 parameter field in Selection Screen for entering a MARC field name. (P_FIELD)
    Now the Program has to display the values of this Field (Entered by the user as P_FIELD) from MARC table, where MATNR is in SO_MATNR.
    I understand that this would require a dynamic select statemant but could not figure out the correct way.
    Please help me with the code for this requirement
    Regards,
    Sunil

    Not sure If I understand correct, but here's an example on what I think you are looking for. I don't have an ECC system here (we're on CRM), but you should adept it to your tables and fieldname.
    TABLES: but000.
    DATA: lt_feld TYPE TABLE OF name_feld,
          lw_feld LIKE LINE OF lt_feld.
    SELECT-OPTIONS: so_part FOR but000-partner.
    PARAMETERS: field TYPE name_feld DEFAULT 'MC_NAME1'.
    SELECT (field) FROM but000
      INTO TABLE lt_feld
      WHERE partner IN so_part.
    LOOP AT lt_feld INTO lw_feld.
      WRITE:/1 lw_feld.
    ENDLOOP.

  • Dynamic date selections

    I use the following query to get the average days per order, for a month. It sums the datediff of all the dates and divides by the total number of open orders for the month,in this case Jun 09, which I hardcoded.
    SELECT Avg_Aging, Site FROM
       SELECT DISTINCT CAST(CAST(SUM(DateDiff(day,Date_Arrived, GETDATE()) + 1 ) AS DECIMAL)
       /CAST(COUNT(orderNumber)AS DECIMAL) AS DECIMAL (10,1)) AS Avg_Aging, Site
       FROM ordersTable INNER JOIN siteMasterr
       ON ordersTable.Site_ID = siteMasterr.Site_ID
       WHERE status NOT IN ('Voided','Closed')
       and date_arrived >= '06/01/2009' and date_arrived < '07/01/2009'
       GROUP BY Site
      ) AS I
    where site = 'Florida'
    What I need to know is, instead of hardcoding the date_arrived, for each month, how can I do it dynamically, so that each time I run this, it will get all the data for Jan 09, then Feb 09, etc., up to Jun 09. July 09 is not complete yet, so it should not do anything else after Jun.

    You can do this month-by-month rollup with a single query, but it's going to take a bunch of date arithmetic that is dependent on the make and model of table server you're running.
    In pidgin Oracle SQL it would be
    SELECT SUM(Sale) AS Sales
                 State,
                 TRUNC(Saledate, 'MM') AS month  -- the month in which the sale took place
    FROM Sales
      WHERE Saledate >= ADD_MONTHS (TRUNC(SYSDATE, 'MM'), -6)  -- six months before the first of this month
          AND  Saledate < TRUNC(SYSDATE,'MM')  -- the first of this month
    GROUP BY State, TRUNC(Saledate, 'MM')
    There's a wonderful book by Prof. Richard Snodgrass of Arizona State University on time-based databases here.  He has lots of examples in the languages of various makes and models of server.
    http://www.cs.arizona.edu/people/rts/tdbbook.pdf

  • Dynamic date in variant

    Hi,
    I need to create a dynamic date for my variant.
    Date will be the select option - The from date should be the current date and the to date should be current date + 30 days.
    When i am using the Selection variant and using the option D to calculate the current date+ 30 days. But that is getting stored in the from date but not in the to-date. My report will be running in back ground every day. So according to the requirment i need to have from date as current date and to-date as current date + 30 days.
    I cannot use the logic in initialization as the report will be running based on the variant saved.
    Thanks,
    Raju

    Hi Raj,
    I can think of one thing,
    just use parameters for start date and end date
    and then set the their values in the variant as follows,
    Press Save on the selection Screen and then put the name and short text then,
    in the very last box called "Selection screen objects 1000" check on the fourth check box "Selection variable" for both start date and end date.
    Then click on "selection Variable" Button on left hand top corner of the screen.
    Then click on the D: Dynamic date calculation the must turn Green.
    then click on the downward arrow that appears there you will have options to set the date.
    there choose current date for the start date and Current date +/- ??? days  for the end date.
    now while setting the end date it will ask you the number of days there you have to put 30(as it is your requirement) and SAVE.
    Then test it .
    otherwise you can go for this approach.
    Keep your date in select-options only and use the following option while selecting "Selection variables"
    "Current date - xxx,current date + yyy"
    Hope it helps you,
    Regards,
    Abhijit G. Borkar
    Edited by: Abhijit Borkar on Jan 7, 2010 7:31 AM

Maybe you are looking for