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

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 ?
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.
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.
hope it helps,

Similar Messages



    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
          i_datum_bis = x_stdat
          i_datum_von = x_enddat
          e_monate    = x_no_months.
    x_no_months will contain no.of months.

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

    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

    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'
    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.
    "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
    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;
    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..

    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...
    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.
    [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)
    Thank you,

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

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

    Try This

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

    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
    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.
    form getdays
    tables itab
    using fromdate todate.
      data : curdate type sy-datum.
      curdate = fromdate.
        if curdate > todate.
        itab = curdate.
        append itab.
        curdate =  curdate + 1.
    endform.                    "getdays
    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.

    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

  • 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.
    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. 
    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!
    Moderator message: date calculation questions = FAQ, please search before posting.
    Edited by: Thomas Zloch on Nov 2, 2010 5:25 PM

         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
       DATE          = v_date11
      WEEK          = WEEK
       MONDAY        = MONDAY <-- will have the week starting day
       SUNDAY        = SUNDAY

  • 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',
    <cfset end_date = DateFormat('09/30/2009',
    <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#"
    <cfset tmp_start = DateFormat('#schoolyear_start##rec#',
    <cfset tmp_end = DateFormat('#schoolyear_end##rec + 1#',
    <cfif DateCompare(tmp_start,start_date) gt -1 and
    DateCompare(tmp_end, end_date) eq -1>
    <cfset count = count + 1>
    <br>There are #count# school year periods between
    #start_date# and #end_date#

Maybe you are looking for

  • Exit button not visible in standard applications

    Hi all, When we call a standard ESS application ( bank or address) from the detailed navigation, the exit button is not appearing in the application. However, when we open the same application from the area page, the exit button is appearing correctl

  • Networked Macs see Windows server, but suddenly not the internet

    My girlfriend works at a small business running about 10 PCs and a Windows server. Also on the network are about 15 VOIP telephones. She's had an emac on the network working fine for a few months. It was connecting to the server and the to the intern

  • WindowServer stuck during booting - only safe mode works

    Since today during working it seems the WindowServer stopped functioning. I can only start the Mac with Shift-Down = Safe Boot. Then it works with all connected screens, but is obviosley unusable, because nothing is working without the extensions. So

  • Fragmentation/Defragmentation of space in Database

    Hi, Oracle DB version : OS version HP-UX B.11.31 U ia64 DB size : 2TB We have the above configuration for one of our oracle database. One of our DBA acts like he is only the person on this earth who is managing the process of fragmentation

  • Has anyone deployed in production using SOASuite ?

    Just want to check if anyone is using ESB / Oracle BPEL in production. Lately we have been facing some issues and we r wondering if we should cut our losses or is it worth continuing ?