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

Similar Messages

  • 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.

  • 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.

  • 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.

  • 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.

  • Dynamic date range in the variant

    Hi,
    We have a background job that is scheduled to run on every 25th. One step of the job has a selection screen which has a Payment date range which is to have the dates 25th of previous to the 24th of the current month.
    So every month this needs to be updated dynamically. For ex: If I look at the variant of the step of the job in period 04 the date should be "03/25/2010 to 04/24/2010". If I look in Period 05 then it should be "04/25/2010 to 04/25/2010".
    Can anyone tell me if this can be achieved through a variant or does this have to be put in the code?
    Regards,
    raj/

    You can create a dynamic variant using STVARV following the steps in the given link...
    http://wiki.sdn.sap.com/wiki/display/ABAP/Creatingdynamicvariantusingtable+TVARV
    Now, the values in TVARVC need to be updated for each period. It can be done scheduling a separate BDC program, which runs for each period and updates the values. So, your date values will be changed for a new period by the background job and program variant wil pick up automatically the values from TVARVC. Check this link, which depicts a similar kind of requirement.
    Re: Update TVARVC Table Dynamically
    You can also calculate the values in intialization event each time the program runs as suggested by Sumit. But, if you need a variant then it won't help. The advantage with TVARVC is you can maintain different set of variants with different values.

  • 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

  • Tricky dynamic date variant in ABAP query

    Hello All,
    In an abap query there is a date field in the selection screen with from & to values.
    I am trying to create a dynamic variant that will fill the following data into those fields:
    From date: will be left blank
    To date: will show today's date - 90 days
    For example, if today's date is 01/12/2006 the variant should fill the following data into the fields:
    From date: <blank>
    To date: 01/09/2006
    I have tried all the methods I know with dynamic dates calculation in the variant definition but did not manage to create such variant.
    Any help will be very appreciated and points would be rewarded generously !
    Thank you very much,
    Ronen

    If the "from" date is meant to be left blank (beginning of time) and the "to" date is some date plus or minus number of days from today, you use the "current +/- days" dynamic date calculation format as was mentioned earlier.  Likewise if the "from" date is some date plus or minus today's date, and the "to" date is infinity -- you only need the one Dynamic Date calculation.
    To do this, first don't think about this as a date range, think of your Dynamic Date calculation as if this were a single parameter and not a select-option.  You are really saying "my date is anything LT/LE this date" or "my date is anything GT/GE this date" -- not a range
    In the Save Variant screen, find the desired date select-option and:
    1. Choose in column "Selection Variable", a "D" (Dynamic date calculation)
    2. Use F4 in the "Name of Variable" column
    3. Find "Current date +/- ??? days" or "Current date +/- ??? work days" in the popup, as appropriate
    4. For "I/E" (include/exclude) column select as appropriate
    5. For "Option" column, choose "LE", "LT", "GE", "GT", "NE" as appropriate
    6. After clicking green check mark, enter your plus or minus days (and factory calendar if using work days).
    7. Finish saving your variant.
    8. You may not see your changes in your variant until you back all the way out of the variant and then redisplay it.  You'll see a greyed out date along with the symbol matching your choice (LT, LE, etc.)
    Unfortunately if you don't have infinity on either end of the date you are limited to 999 days differences as far as I am aware.  If that is the case you can populate TVARVC table with parameter or selection variables, maintain them with STVARV transaction by hand, or use an ABAP program in batch to regularly calculate the values.  Then you can reference the TVARVC values in your variant instead of the Dynamic Date calculation.
    If someone knows a way to bypass the use of TVARVC for date ranges that are more than 999 days apart please let me know.  TVARVC works well but it is extra effort whereas Dynamic Date calculation would be much easier to maintain if the date range could be made larger than 999 days.

  • Fiscal Calendar in Report Variant Dynamic Date Calculation

    We are switching from the standard calendar to a 4/4/5 calendar for our fiscal calendar. We have a number of batch reports that use dynamic date calculation in the variant to get Month-To-Date or Previous Month date ranges. Is there a way to convert these variants to use the new FiScal calendar instead of the regular calendar?

    thanks to answer , praveen.
    I know, VARI has name of FM , but not has Calendar ID.

  • Dynamic date calculator

    Hi all
    In Variants we can give dynamic date calculator to calculate date as we required. Does there is a option to add more selection option (ie if I have to add a selection last day of next month). Where I can do this
    Please comment
    With Regards
    Arun

    check the LSVAVF01 program for enchancement. or dynamic date selection you can select "  nth working day of current month " with calender option to select the last date of month.

  • Dynamic date range

    I'm on ECC6.0, and looking to set up a dynamic date range in a variant.
    The date range is a select-option on my selection screen.
    I can easily setup the dynamic date for the 'low' value in the range,
    but I can see no way to also declare a dynamic date in the 'high' value.
    I also looked in TVARV maintenance and it doesn't seem possible there
    either, as there's no way to declare variable values.
    If I can't resolve this, I will have to change my program to include a
    default high date and use that.
    But even that may not work if we call the variant, which may overwrite
    my default in the high value of the range with a blank value.
    Does anyone know how to do this?
    Thanks in advance for your help.

    Hi Jagan,
    If you save the variant you can choose some options for the select-option. If you choose selection variabel type D (dynamic date calculation) you can choose out of several Names of Variables that provide for a LOW and HIGH value.
    If you use type T, you can choose a variable that is stored in tabel TVARVC. You can add your own variable to table TVARVC using SE16.
    Regards........
    Chaitanya.

  • Dynamic date variant in selection screen

    I have a selection option s_date in my program where I want to use the dyanmic variant with.
    it is a date range and for the lower range, I would like to have a static value of 04/01/2010 and for the higher range I want to have last date of the prev month.
    I see last date of the prev month in the drop down (F4) Dynamic table, but selecting that is overwriting the s-date-low instead of s_date-high. How can I use the dynamic variant for this ? Can i create my own custom drop downs for these dates?
    S_DATE      FROM  (_04/01/2010_)  TO (LAST DATE OF PREV MONTH)
    Thanks in advance..

    In variant you can specify dates dynamically.
    When you save a variant, system ask you enter variant name and Meaning. On the same screen you can specify these dynamic values.
    For the parameter/select-option where you want to specify dynamic value, press F4 on 'Selection Variable' column.
    Choose type of variable as 'D' (Dynamic date calculation).
    Press F4 on 'Name of Variable(Input only using F4) column and select 'Current date +/- ??? days' on next screen.
    On input screen enter -1.
    Repeat same for To Date' field.
    Prabhudas

Maybe you are looking for

  • List view in Address Book

    I have recently upgraded to Snow Leopard, but notice in Address Book that prefixes(Mr, Mrs etc) do not appear in the list view, but do on the card. In Leopard the prefixes appear in both views. Is this just a fault in the program, or can it be rectif

  • How to get request_ Id  in control file?

    Hi, I am using "fnd_global.conc_request_id" in control file to get request_Id but always getting request_id value as '-1' while running the SQL *Loader program. Any setup is missing here or is there any other way to get request_id in control file. Th

  • [CS3-CS5|JS] is there a script to apply creep to artwork?

    I work for a commercial printer and we have RIP software which, when requested, applies creep to impositions. it literally pushes the pages in the imposition closer to the spine in increments of the total creep calculation. Out of curiosity more than

  • Maverick: doc saving function in Word for Mac

    I just downloaded Maverick for my 2010 iMac. I'm happy with it but for one problem: saving documents in my Word for Mac 2008 is a royal pain. Instead of the good old one-step save process under Snow Leopard's Word for Mac, Word/Maverick now requires

  • UTL_TCP Message sent as plain text arrives as html.

    Hi I wonder if anyone knows the answer to this. I'm using UTL_TCP to send a multipart mime message, basically a plain text email with an html attachment. I have sent this to different users, who have internet webmail ( eg yahoo) or just standard Micr