Spliting user entered date range into u201CFrom Date u201C and u201C To dateu201D-user exit

Hi,
In the query i have a created a popup variable for date range for which the processing type is customer exit. When the user exceutes the query he gets the popup for the date range with the default values. The default values are set one month backward.
For example: if today is 5/19/2008, then the popup date range shows 4/19/2008 to 5/19/2008.
Already there is an user exit written for the same.
Now the requirement is i need to split From date and to date entered by user and use them in seperate selections to restrict the keyfigure in the keyfigure column of the query.
Can anyone throw a light on this, how to go about?
Shall i need to create two different variables from date and two date and populate the values, if yes how can i do that ?
Thanks,
Rani.
Edited by: rani on May 19, 2008 10:22 AM

Hello Rani,
                 Check this code,
var1 is already existing variable with values from date and to date values.
ztest1 is the first customer exit single variable,
ztest2 is the second customer exit variable.
ztest1 and ztest2 you can use these variables in the restricted keyfigures which you have mentioned.
when 'ztest1'.
    if i_step = 2. "after the popup
      loop at i_t_var_range into loc_var_range
      where vnam = 'var1'.
        clear l_s_range.
        l_s_range-low = loc_var_range-low.
        l_s_range-sign = 'I'.
        l_s_range-opt = 'EQ'.
        append l_s_range to e_t_range.
        exit.
      endloop.
    endif.
when 'ztest2'.
    if i_step = 2. "after the popup
      loop at i_t_var_range into loc_var_range
      where vnam = 'var1'.
        clear l_s_range.
        l_s_range-low = loc_var_range-high.
        l_s_range-sign = 'I'.
        l_s_range-opt = 'EQ'.
        append l_s_range to e_t_range.
        exit.
      endloop.
    endif.
hope it helps,
regards,
karthik

Similar Messages

  • CONVERT   DATE RANGE INTO MONTHS

    HI FRIENDS,
    ACTUALLY IN MY SELECT-OPTIONS I HAVE USED DATE BETWEEN 03/06/1980  TO 04/12/1980
    BASED ON THIS DATE I HAVE TO CALCULATE NUMBER OF MONTHS.
    WILL THIS BE DONE AUTOMATICALLY OR I NEED TO WRITE ANY CODE FOR CONVERTING THE DATE RANGE INTO NUMBER OF MONTHS.
    REGARDS
    SIRI.

    Hi,
    Use FM's : MONTHS_BETWEEN_TWO_DATES_NEW
               MONTHS_BETWEEN_TWO_DATES
               FIMA_DAYS_AND_MONTHS_AND_YEARS
    Sample code :
    DATA : x_no_months type i.
    DATA : x_stdat like sy-datum,
           x_enddat like sy-datum.
           x_stdat  = s_date-low
           x_enddat = s_date-high
    CALL FUNCTION 'MONTHS_BETWEEN_TWO_DATES'
        EXPORTING
          i_datum_bis = x_stdat
          i_datum_von = x_enddat
        IMPORTING
          e_monate    = x_no_months.
    x_no_months will contain no.of months.
    Regards
    Appana

  • Date range for key date in hierarchy

    Dear Friends,
    Is there a work around for single key date restriction for time dependent hierarchy.Bcos i can only select one key date in teh report for my hierarchy so that it will take that hierarchy which falls in this date and display the result accordingly.
    But is there a way to select the date range for key date so that more than one hierarchy can be used to display my report accrding to the time range.
    Say,i have 4 hierarchies (time dependent) like v1,v2,v3,v4 and v5 for jan 08,feb 08,mar 08,apr 08 & may 08 respectively.
    In my report,i want to display the result for the time interval say mar to May.
    So my report should diplay the result according to the 3 different hierarchies for the time period i.e.v3,v4&v5.
    How do i acheive this.
    Thanks.
    ragu

    Hi
    I think we may do with the Char with text with replecement path.
    take time char as Calmonth and set the offet value as -1 and -2 and design the report and use the hierarchies in that query.
    Am not surt it willwork but better to try with this.

  • Sql Loader loading separate date parts into a date

    Hello,
    I'm having a question on SQL Loader.
    Suppose I have a flat file with a format:
    "John Jackson", 2007, 12, 31, 23, 59, 01
    "William Smith", 2007, 12, 31, 23, 59, 02
    "Tracy vanDijk", 2007, 12, 31, 23, 59, 03
    And I like to put it in a table TEST with (name varchar(20), mydate date).
    The problem is: how to create a control file for sqlLoader that converts the seperate date-elements into a date field?
    load data
    infile 'mydata.csv'
    badfile 'badfile.log'
    discardfile 'discardfile.log'
    append
    into table TEST
    fields terminated by "," optionally enclosed by '"'          
    ( name, mydate ????)
    I'd like to put it in one step into a date field, and not using seperate tables, stored procedures, triggers and such. I think it must be possible, but I wasn't able to find a working example thus far.
    Hope you can help me out.

    A colleague came up with the BOUNDFILLER option. Searching again on the forum I created the solution, that I'd like to share with you.
    SQL> create table TEST1 (naam varchar(30), meetdatum date);
    Tabel is aangemaakt.
    mydata.csv:
    "Scott Tiger", 2006, 02, 18, 23, 59, 4
    "Frank Naude", 2007, 12, 31, 18, 00, 59
    "Fou TeDatum", 2007, 02, 31, 01, 10, 5
    "Johnny Smith", 2007, 1, 1, 12, 00 , 00
    laden.ctl:
    load data
    infile 'mydata.csv'
    badfile 'badfile.log'
    discardfile 'discardfile.log'
    into table test1
    fields terminated by "," optionally enclosed by '"'     
    trailing nullcols     
    ( naam
    ,b_yyyy boundfiller char
    ,b_mm boundfiller char
    ,b_dd boundfiller char
    ,b_hh24 boundfiller char
    ,b_mi boundfiller char
    ,b_ss boundfiller char
    ,meetdatum "to_date(:b_yyyy || :b_mm || :b_dd || :b_hh24 || :b_mi || :b_ss , 'YYYYMMDDHH24MISS')"
    SQL> alter session set nls_date_format = 'YYYY-MM-DD:HH24:MI:SS' ;
    SQL> select * from test1;
    NAAM MEETDATUM
    Scott Tiger 2006-02-18:23:59:04
    Frank Naude 2007-12-31:18:00:59
    Johnny Smith 2007-11-12:00:00:00
    The wrong date, Feb 31st, is spooled to the badfile.

  • I am unable to add Data element into existing Data Type

    Hi Experts,
    I am unable to add Data element into existing Data Type, It shows disable mode, suggest me this..
    Thanks

    Yep got it...
    Edited by: Manoj on Aug 20, 2008 1:09 AM

  • I'm a user of Mac OS X 10.4 Tiger and, as well, a user of Google fead reader, which will stop to work from July 1st 2013. Does anybody know of any alternative RSS reader which works on OS X 10.4? Thanks in advance.

    I'm a user of Mac OS X 10.4 Tiger and, as well, a user of Google fead reader, which will stop to work from July 1st 2013. Does anybody know of any alternative RSS reader which works on OS X 10.4? Thanks in advance.

    Hello, you still might be in luck...
    TenFourFox is the most up to date browser for our PPCs, they even have G4 & G5 optimized versions...
    http://www.floodgap.com/software/tenfourfox/
    In TFF>Preferences>General>Manfe Add-ons..., type rss in the Search all add-ons bar...

  • Today's date dynamically entered into text field that user enters additional text into same field.

    Trying to have today's date dynamically entered into a repeating table row textfield when the button is clicked to create each repeating row. The user can then enter addtional text into the same text field next to the date.
    Example:
    [4/25/2012] This is the text the user entered.
    Today's date is populated in each update row created when the "Update Row" button is clicked.
    The following script works but only for the first instance, not the second, third, forth, etc...
    Click event: (JavaScript, client)
    this.resolveNode('Table2._RowB').addInstance(1);
    xfa.resolveNode("Table2.RowB.#subform.Update").rawValue
    Thank you,
    ~Don

    Hi Don,
    Does this solution cover the above problem? https://acrobat.com/#d=VjJ-YsXLKmV6QU84JrAAIw
    Niall

  • Need work around to split date range into months

    Hi All,
    I have a requirement to split the data range in source table to months.
    here is the source table
    ID Sdate Edate Code
    ===============================
    501 1/4/2009 4/30/2009 AH
    501 5/1/2009 9/30/2009 AB
    502 1/1/2014 5/31/2014 AC
    Here is my target
    ID Sdate Edate Code
    ================================
    501 1/4/2009 1/31/2009 AH
    501 2/1/2009 2/28/2009 AH
    501 3/1/2009 3/31/2009 AH
    501 4/1/2009 4/30/2009 AH
    501 5/1/2009 5/31/2009 AB
    501 6/1/2009 6/30/2009 AB
    501 7/1/2009 7/31/2009 AB
    501 8/1/2009 8/31/2009 AB
    501 9/1/2009 9/30/2009 AB
    502 1/1/2014 1/31/2014 AC
    502 2/1/2014 2/28/2014 AC
    502 3/1/2014 3/31/2014 AC
    502 4/1/2014 4/30/2014 AC
    502 5/1/2014 5/31/2014 AC
    Please provide some input.
    Thanks a lot in advance.

    That means your database is in a different locale than mine. When I select cast(Edate as varchar), I get the date returned in the format 'YYYY-MM-DD'. That's why I use(left(cast(Edate as varchar),4) + right(left(cast(Edate as varchar),7),2) to get it the format 'YYYYMM' before converting it into an integer.
    Your database most probably returns dates in a format like D/MM/YYYY. That's the reason for the error you get. You'll have to select (right(cast(Edate as varchar),4) + left(right(cast(Edate as varchar),7),2) to obtain the same results as I do.
    Alternatively, you can use the convert function to obtain the same results:
         select max(
         cast(left(convert(varchar,Edate,102),4) + right(left(convert(varchar,Edate,102),7),2) as int) + 1 -
         cast(left(convert(varchar,Sdate,102),4) + right(left(convert(varchar,Sdate,102),7),2) as int))
         FROM src_split'
    It's always good practice to test the SQL-statements in your database client first before including them in a DS script.
    Also, I suddenly realise this statement will only return the correct result when your Edate and Sdate are always within the same year. If that's not the case, but the gap between Edate and Sdate is always less than 10 years, change your statement to:
         select max(
         cast(left(convert(varchar,Edate,102),4) + right(left(convert(varchar,Edate,102),7),2) as int) + 1 -
         cast(left(convert(varchar,Sdate,102),4) + right(left(convert(varchar,Sdate,102),7),2) as int)) % 88
         FROM src_split'

  • Opendoc date range into Bex query

    We are having an issue when trying to pass a date range in an Opendoc link. The report is built off a BEx query,  within the report we have an Opendoc link into a child version of the report. I can pass all the other prompts with no issue except for one which is the date range.
    I am defining the date range as "[19000101]..[19000101]" but we keep getting this error message:
    Has anyone lese had this issue?
    Thanks

    Hi,
    Try This
    "[Date(2014,04,01)]..[Date(2014,04,11)]"
    "[Date(yyyy,MM,dd)]..[Date(yyyy,MM,dd)]"
    http://help.sap.com/businessobject/product_guides/boexir4/en/xi4_opendocument_en.pdf#page=26
    http://<servername>:<port>/BOE/OpenDocument/opendoc/openDocument.jsp?iDocID=Aa6GrrM79cRAmaOSMGoadKI&sID
    Type=CUID&sRefresh=Y&lsRTime+Period:=[2000..2004)
    http://<servername>:<port>/BOE/OpenDocument/opendoc/openDocument.jsp?iDocID=Aa6GrrM79cRAmaOSMGoadKI&sID
    Type=CUID&sRefresh=Y&lsRparamStringDR=[h..i]&lsRparamNumberDR=[7..8]&lsRparamCurrencyDR=[3..4]&lsRparamDat
    eDR=[Date(2003,6,7)..Date(2003,6,8)]&lsRparamDateTimeDR=[DateTime(2003,6,1,7,1,1)..Date
    Time(2003,6,1,8,1,1)]&lsRparamTimeDR=[Time(1,1,7)..Time(1,1,8)]&lsRparamUnbound1=(..6)&lsRpara
    mUnbound2=[6..)&lsRparamStringR=[a..d]&lsRparamNumberR=[1..3]&lsRparamCurrencyR=[1..3]&lsRparam

  • Function Module for separating a date range into days

    Hi all,
    Does anyone know if there is a function module which gives back the list of days when we give a date range as input parameter to the function module. For example, we enter the range 10.07.2006 - 13.07.2006 and the function module gives back a table  in form 10.07.2006, 11.07.2006, 12.07.2006, 13.07.2006.
    Thanks,
    Sükrü

    Hi suekrue,
    1. Exactly for this purpose,
       i have written an
       INDEPENDENT FORM (subroutine)
      wherein we pass
       a) fromdate
       b) todate
       c) ITAB
    2. and it gives all the dates in the internal table.
    3. just copy paste
    4.
    data :  itab type table of sy-datum with header line.
    parameters : fromdate type sy-datum default '20060701'.
    parameters : todate type sy-datum default sy-datum.
    perform getdays tables itab using fromdate todate.
    break-point.
    FORM
    form getdays
    tables itab
    using fromdate todate.
      data : curdate type sy-datum.
      curdate = fromdate.
      do.
        if curdate > todate.
          exit.
        endif.
        itab = curdate.
        append itab.
        curdate =  curdate + 1.
      enddo.
    endform.                    "getdays
    regards,
    amit m.

  • How can I set a date range for a Date/Time Field in LiveCycle ES2?

    I need to set a specific date range for a form set up in LiveCycle ES2. Cannot see where i allows me to do that without a code entered.

    Hi,
    You can't set a start and end date for the date/time field, the best you can do is validate the range after the user has selected it.
    An alternate is to make your own date / time field, like this sample http://adobelivecycledesignercookbookbybr001.blogspot.com.au/2013/05/an-alternative-date-p icker-for.html
    Regards
    Bruce

  • How can we restrict the date range in the date picker

    While selecting any date a pop up date picker appears. In this date picker the users can select any future dates which can be 30-40 yrs ahead. How can customize this date picker so that the users are not allowed to slected date beyond certain range. ...??

    Hi user570596,
    I think there is no method to actually restrict the date picker popup, but you can use the ApexLib Framework (http://apexlib.sourceforge.net/) to define a min/max value for your date field. This will prevent the user from submitting the page when the date value is outside the defined range.
    See http://inside-apex.blogspot.com/2007/03/min-max-value-validation-in-browser.html
    for details.
    Patrick
    Check out my APEX-blog: http://inside-apex.blogspot.com
    Check out the ApexLib Framework: http://apexlib.sourceforge.net

  • Determining Date Range from Pay Date Information

    I have a table of employees with different pay dates because they are college interns and they leave at different dates, so their most recent pay date will be different. I have created a query to find the most recent pay date.  The pay periods are bi-weekly.
    I have a table called tblPayPeriods with all of the pay dates. I have created a query that pulls the most current pay date for each intern and I want to match that pay date to the pay date of the Pay Periods table and increment back twenty pay periods. 
    Once I have determined the oldest pay date I want to use that range for a calculation for average hours ultimately.  I can handle the average hours part but I'm having trouble with the pay dates part of this. Any suggestions would be appreciated. 
    Thanks!
    Here is the SQL statement to find the most current pay date for each intern:
    SELECT tblMeasurementPeriod.EENum, Max(tblMeasurementPeriod.[Pay Date]) AS [MaxOfPay Date]
    FROM tblEmployees INNER JOIN tblMeasurementPeriod ON tblEmployees.[EE Num] = tblMeasurementPeriod.EENum
    WHERE (((tblEmployees.[Measurement Period])="initial"))
    GROUP BY tblMeasurementPeriod.EENum;
    Here is the SQL statement using the query joined to the pay date table:
    SELECT qryFindLatestPayDateforINITIAL.EENum, qryFindLatestPayDateforINITIAL.[MaxOfPay Date], tblPayDate.[Pay Date]
    FROM qryFindLatestPayDateforINITIAL INNER JOIN tblPayDate ON qryFindLatestPayDateforINITIAL.[MaxOfPay Date] = tblPayDate.[Pay Date];
    Alicia Hunsberger

    You have the Intern Last Pay Date (LPD)
    You want to match that LPD to the pay date of the Pay Periods table...
    ** so the first question is - are you able to? what is the obstacle on this?
    and increment back twenty pay periods
    ** is there a fixed math you can rely on, such as subtract 180 days?...will that work to determine the pay date 20 periods previously?  it would be great if the pay periods had a sequential integer in their record - - - that would make it easy....

  • Function Module which will take Wekk No & Return date range (from & To dat)

    Hello everyone,
    I need a Function Module which will take Week No as an input Parameter & return me the date range
    (From date & To date of that week) .
    Thanks in advance!
    Cheers!
    Moderator message: date calculation questions = FAQ, please search before posting.
    Edited by: Thomas Zloch on Nov 2, 2010 5:25 PM

    Hi,
         Please write the below logic..
    data : v_date11 type sy-datum,
              monday    type sy-datum,
              sunday  type sy-datum,
              v_count1 type i .
    *v_count1 = 20 * 7.            "   Say U want details for 20th week , or give a parameter for week and multiply with 7*
    v_date11 = '20100101'.     "   take the starting day of the year ....
    v_date11 = v_date11 + v_count1.   " add to the date
    CALL FUNCTION 'GET_WEEK_INFO_BASED_ON_DATE'   <-- call this FM
    EXPORTING
       DATE          = v_date11
    IMPORTING
      WEEK          = WEEK
       MONDAY        = MONDAY <-- will have the week starting day
       SUNDAY        = SUNDAY
    Regards,
    Srini.

  • Date Range Within a Date Range

    I'm suffering from a mental block on this one and I'm hoping
    someone here can help. What I need to do is determine how many date
    ranges are between a broader date range. For example a school year
    runs from 9/1 to 6/30 or 180 work days. What I need to do is
    compute the number of 9/1 to 6/30 periods between say 1/1/2007 and
    9/30/2009. The result of this find is used in othere calculations
    in a rather complex report. Any help is appreciated.

    Yet another method...
    <cfset start_date = DateFormat('01/01/2007',
    'mm/dd/yyyy')>
    <cfset end_date = DateFormat('09/30/2009',
    'mm/dd/yyyy')>
    <cfset start_year = DatePart('yyyy', start_date)>
    <cfset end_year = DatePart('yyyy', end_date)>
    <cfset schoolyear_start = '09/01/'>
    <cfset schoolyear_end = '06/30/'>
    <cfset count = 0>
    <cfloop index="rec" from="#start_year#"
    to="#end_year#">
    <cfset tmp_start = DateFormat('#schoolyear_start##rec#',
    'mm/dd/yyyy')>
    <cfset tmp_end = DateFormat('#schoolyear_end##rec + 1#',
    'mm/dd/yyyy')>
    <cfif DateCompare(tmp_start,start_date) gt -1 and
    DateCompare(tmp_end, end_date) eq -1>
    <cfset count = count + 1>
    </cfif>
    </cfloop>
    <cfoutput>
    <br>There are #count# school year periods between
    #start_date# and #end_date#
    </cfoutput>

Maybe you are looking for

  • How to Make Field "Creation Date" Mandatory (in EP Selection Screen)

    Dear experts, I am on SRM 7.0. In Shopping Cart, i'd like to set Field "Creation Date" as Mandatory Field in EP Selection Screen / Criteria Maintenance. Is there BADI or SPRO need to be maintained? Thanks & regards, Jack Edited by: Jack4ever on Aug 9

  • Multiplication in DMEE

    Hi Experts! I'm facing an issue I would like to share with you and ask for your help. I'm creating a new DMEE format tree and I have to use multiplication in one field. Is it possible at all? I need a field "Taxes" which should be calculated as: Comm

  • Somehow 3000 projects moved to trash and i cannot get them out with "undo" or otherwise

    somehow 3000 projects moved to trash and i cannot get them out. I followed instructions but undo does not work. Need help!!! I have nnot deleted the trash.

  • I get run time error in step Set Report in reportgen_xml sequence

    I get run time error in step "Set Report" in reportgen_xml.seq. The error code is "Out of memory". I don't know what to do. I use BatchModel, I have 6 batch loops. The problem appears on the 3d loop. I have NI 3.5. Help me!!!!!! I send attachment (sc

  • What is this, how to remove?

    I'm getting what appears to be a single frame that I can't get rid of. It's not on the end of the clip, as you can see. There's no single frame that I can select and delete. The man you see is in a clip, two clips back. I tried deleting all the clips