Passing the Date range within the query

Hi ,
In my query , I have two date characteristic, and while doing the selection I have to do selection on only one date field.
This selection is a date range selection , So I have used a selection variable for this.
Can anyone please let me know if it is possible to pass the selection range to other variable. Is it possible to use Customer exit to pass the complete range.
Thanks
Altair

Hi,
You can do it in the user exit.And that is the only approach to transfer the values of one variable to other variable .
Search this forum for the code. you will find  lot of postings.
With rgds,
Anil Kumar Sharma .P

Similar Messages

  • Can I use SYSDATE in the WHERE clause to limit the date range of a query

    Hi,
    Basicaly the subject title(Can I use SYSDATE in the WHERE clause to limit the date range of a query) is my question.
    Is this possible and if it is how can I use it. Do I need to join the table to DUAL?
    Thanks in advance.
    Stelios

    As previous poster said, no data is null value, no value. If you want something, you have nvl function to replace null value by an other more significative value in your query.<br>
    <br>
    Nicolas.

  • 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

  • How to get the date range for a given fiscal period.

    Hi All,
    There is two fields (select options) on my selection screen
    1. Fiscal Year
    2. Fiscal Period.
    I just want the date range between the given year and period on selection screen.
    Thanks,
    Gaurav Mittal

    Check FM's FIRST_DAY_IN_PERIOD_GET and LAST_DAY_IN_PERIOD_GET.

  • ICal sync- alert says will delete all past entries- Yes, I have my Keep Appointments set to "forever" AND I've tried changing the date range in desktop mgr- HELP

    I just did the update for the software on the 8530.  This is a new problem since the update.  I cannot lose my old entries, so I am unable to sync at all now until Blackberry addresses this bug.
    I have read through all of the "fixes" but none of them work.
    My Keep Appointments setting has always (and I verified is still) set to "forever"
    I went into the advance settings on the MAC desktop software from Blackberry and tried changing the date range to the suggested 14 days past and 365 days future.  I even tried changing the past days parameter to "1" in hopes it would simply ignore old entries... It still wants to delete 435 past entries.
    I have to keep these.
    Help, Blackberry!  Your "update" to the software is overriding my settings and has made the sync function unusable.

    Christina,
    Thanks for the reply. I unchecked all calendars in iCal and synced and it still gave me the same notice. So then I went into the iTunes window and checked the sync only certain calendars box (instead of the all calendars box) and left all the calendars unchecked and clicked apply but when I click on sync it automatically reverts to all calendars.
    When you say you unchecked all calendars did you mean in iCal? And what did you have your iCal settings at in your iTunes sync window?
    I appreciate your help,
    Andrea

  • Passing a date range to a Crystal Report using OpenDocument

    Hi,
    I am trying to call up a Crystal report in InfoView using a hyperlink with the OpenDocument function call.
    It is working fine with the following URL:
    http://<server name>:<port>/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=ARcnOcErTA1FidjRJ_sT0Yw&sType=rpt&sRefresh=Y&lsSCompany+Code=1300&lsMCost+Center=[12345],[67890]&lsSCost+Element=0000100123
    However, once I added the date range into the parameter string, like this:
    http://<server name>:<port>/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=ARcnOcErTA1FidjRJ_sT0Yw&sType=rpt&sRefresh=Y&lsSCompany+Code=1300&lsMCost+Center=[12345],[67890]&lsSCost+Element=0000100123&lsRFiscal+Year+Period=[Date(1,1,2011)..Date(1,9,2011)]
    It returns an error message, "An error has occurred: java.util.Date ", to my browser.
    I am wondering if I am missing any Java library or Java class path.
    Any thoughts are appreciated.
    Joyce
    Edited by: Joyce Chan on Aug 30, 2011 12:25 PM

    How do I check if the parameter passing in is in date type?
    the following is exactly what I've tried:
    &lsRFiscal+Year+Period=[Date(2010,10,10)..Date(2010,10,15)]
    Would the error message be logged in the server, maybe I can find more information for the error log?

  • Pass a date Range from VB to a parameter

    Hello,
    I'm thinking this is an easy question, but ...
    In a Visual Studio 2008 VB program, I'm allowing the user to pick a starting and ending date from DateTimePickers. (works fiine).
    In a CR 2008 report, I have a paramter defined as "pDateRange",  Type = date, Allow Range Values = Yes.
    In the Record Selection, I use a formula of {tblData.INSTALLDT} in {?Date_Range}.
    When I run the report, I can enter the date ranges in via the Enter Values prompt screen, and it works file,
    All I need to know is - how do I pass the dates the user selected in the VB program to the pDateRange parameter?
    Thanks very much,
    Carl

    Thanks Ludek for the reply.
    Unfortunately, I canu2019t seem to puzzle this out.  None of the examples seem to work.  This is an example, along with their comments.
    I get the error "The parameter field current values cannot contain range values because the ValueRangeKind property is set to discrete." on the last line.
    I could REALLY use some help getting past this issue.
           Dim myReportDocument As New CRS_Tab_Prod_Org_Cnt_Params2
            Dim crParameterFieldDefinitions As ParameterFieldDefinitions
            Dim crParameterFieldDefinition As ParameterFieldDefinition
            Dim crParameterValues As ParameterValues
            Dim crParameterRangeValue As ParameterRangeValue
            crParameterFieldDefinitions = myReportDocument.DataDefinition.ParameterFields
            'Access the individual subreport parameter field "Date_Range"
            crParameterFieldDefinition = crParameterFieldDefinitions.Item("Date_Range")
            'Cast the variable to hold the values to pass to the Report before execution
            crParameterValues = crParameterFieldDefinition.CurrentValues
            'Cast the variable to hold the range value for the parameter
            crParameterRangeValue = New ParameterRangeValue()
            'Set the Date range and include the upper and lower bounds. Use the Cdate function as insurance
            'to ensure that the value passed is cast to the appropriate data type
            With crParameterRangeValue
                .EndValue = CDate("1/1/1997")
                .LowerBoundType = RangeBoundType.BoundInclusive
                .StartValue = CDate("12/20/1997")
                .UpperBoundType = RangeBoundType.BoundInclusive
            End With
            'Apply the Date range to the values to be passed to the Report
            crParameterValues.Add(crParameterRangeValue)
            'Pass the parameter values back to the report
            crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)
    Thanks for your help,
    Carl

  • Possible to pass a date range to a subreport?

    Hi,
    I've created a report with three groups and I suppress the second and third group. The first group displays a summary of the details.  If I "hide" the details I have a nice summary looking report which I can then click on to drill down into the details. However, I cannot enable the "hide" functionality because of two reasons: 1. I'm using the crystal java viewer and it has serious limitations when using the hide/drill-down feature; and 2. in order to print I have to click on each group item in order to print - so when I have 20 values in my group I'm going into each group 20 times and printing 20 times.
    So, I still want a summary view of all my group summaries at the front of my report.  How can I consolidate the group values into a single summary view? I attempted creating a subreport that is the same as the main report however the issue is that the initial parameter used is a date *range". I'd like to pass the date range to the subreport and then I'm sure this would all work. Does crystal support passing a date range to a sub-report? If so, how is this done?
    thx!
    Mark

    Hi Mark,
    Yes, you can pass a date range value to the SUbreport!
    Here's how its done:
    1) Create a formula in the Main report; call it Start_date:
    Minimum({?Date_parameter})
    2) Create a second formula in the Main report and call it End_date:
    Maximum({?Date_parameter})
    3) Insert the sub-report and then Right-click the sub-report > Select Change Subreport links > Move the Start_date and End_date formulas to 'Fields to Link to' area and make sure you uncheck the 'Select data in subreport based on field' option.
    4) Edit the sub-report (Right-click > Edit) and insert a Record Selection formula to include the parameters from the Main Report.
    Go to Report > Selection Formulas > Record:
    {date_field} >= {?Pm-@Start_date} and {date_field} <= {?Pm-@End_date}
    Hope this helps!
    -Abhilash

  • MDM ABAP API query to pass the date range

    Hi
    I want to retrieve certain data from MDM repository based on filter criteria by date stamp.
    Not sure how to do it to pass the select option value in the query.
    select-options: s_cdate for sy-datum obligatory .
    DATA  wa_query     TYPE mdm_query.
    DATA: v_search_date1    TYPE MDM_CDT_DATE_TIME.
    data: v_datestamplow1   type string.
    data: v_datestamplow    type TZNTSTMPL.
    concatenate s_cdate-low '000000' into v_datestamplow1
    v_datestamplow  = v_datestamplow1.
    clear wa_query.
        wa_query-parameter_code = 'Changed_On '.             "Field code ( Field name )
        wa_query-operator = 'EQ'.
        wa_query-dimension_type = mdmif_search_dim_field.    "Field search
        wa_query-constraint_type = MDMIF_SEARCH_CONSTR_DATE. "Date  serach
    I am able to get the data when I just pass the low value from selecct option.  But I dont how  to pass the date range.
       v_search_date1-CONTENT = v_datestamplow.
        ET REFERENCE OF v_search_date1 INTO wa_query-value_low.
        APPEND wa_query TO gt_query.
      CALL METHOD cl_api->mo_core_service->query
          EXPORTING
            iv_object_type_code = 'Vendors'
            it_query            = gt_query
          IMPORTING
            et_result_set       = gt_result.
    II could see the below operator types . Although EQ says "Like standard select-options parameter" not sure how to pass the value.
    EQ     Equal to (like standard select-options parameter)
    NE     Not equal to (like standard select-options parameter)
    LT     Less than (like standard select-options parameter)
    LE     Less than or equal to (like standard s-o parameter)
    GT     Greater than (like standard select-options parameter)
    GE     Greater than or equal to (like standard s-o parameter
    SW     Starts with (MDM specific parameter)
    Thanks,
    Krishna.

    Hi,
    To get the date range for select options, pass the low value with 'GE' operator and another query option with 'LE' operator for high value.
    select-options: s_cdate for sy-datum obligatory .
    DATA wa_query TYPE mdm_query.
    DATA: v_search_date1 TYPE MDM_CDT_DATE_TIME.
    data: v_datestamplow1 type string.
    data: v_datestamplow type TZNTSTMPL.
    concatenate s_cdate-low '000000' into v_datestamplow1
    v_datestamplow = v_datestamplow1.
    clear wa_query.
    wa_query-parameter_code = 'Changed_On '. "Field code ( Field name )
    wa_query-operator = 'GE'.
    wa_query-dimension_type = mdmif_search_dim_field. "Field search
    wa_query-constraint_type = MDMIF_SEARCH_CONSTR_DATE. "Date serach
    GET REFERENCE OF v_search_date1 INTO wa_query-value_low.
    APPEND wa_query TO gt_query.
    concatenate s_cdate-high '235959' into v_datestamphigh1
    v_search_date2 = v_datestamphigh1.
    clear wa_query.
    wa_query-parameter_code = 'Changed_On '. "Field code ( Field name )
    wa_query-operator = 'LE'.
    wa_query-dimension_type = mdmif_search_dim_field. "Field search
    wa_query-constraint_type = MDMIF_SEARCH_CONSTR_DATE. "Date serach
    GET REFERENCE OF v_search_date2 INTO wa_query-value_low.
    APPEND wa_query TO gt_query.
    CALL METHOD cl_api->mo_core_service->query
    EXPORTING
    iv_object_type_code = 'Vendors'
    it_query = gt_query
    IMPORTING
    et_result_set = gt_result.
    Thanks.

  • Query output based on the date range ...

    Hi All,
    I have an issue related to the jump query, main query based on the time frame. For Example if he selects Sold_To : 6895 for the Calday 10/01/2007 – 01/31/2008 and when jumps to jump query , the jump query should display the data based on the input given in the main query. That is it should show the data individually for four months.
    Expecting the reply from your side...
    Thanks in advance…
    Regards,
    Sruthi

    Sruthi,
    Make sure that u have those 3 fields in 2nd Query and CALDAY with Variable.
    Create settings in RSBBS.
    Click on ASSIGNMENT DETAILS tab
    CALDAY  >  Type = Variable  > Selection Type = Selection/Single value/Multiple single values ( same like ur first query )
    All other fields ( 3 na ) > Type = Generic
    Click on Continue / Save.
    If you need more info...if possible come to yahoo chat my ID is [email protected]....and am online now.
    Regards,
    Ramkumar.

  • Get the date range

    Hi,
    There is a requirement that we need to get date range.This date range will be arrived at using the function module BKK_GET_PRIOR_WORKDAY. The factory calender id is GB. It should return the date range. Therefore, for weekends the date range will be Saturday, Sunday and Monday.  The date range will change based on holidays that exist in the holiday calendar.
    Now my question is how to calculate that there are two days between friday and monday.
    Please help.

    Hi Nishigandha,
    If i am correct you need the number of days between two dates
    ex:
    date1: 04/06/2009
    date2: 12/06/2009
    you need the number of days??
    then probably check this Fm out:
    SD_DATETIME_DIFFERENCE this is a function module which gives the difference in Days and Time for entered two dates
    P.S Additionally  Chk this out:
    /people/mustafabaris.gunes/blog/2009/03/16/calculating-number-of-working-days-in-query-level
    Hope its useful
    Thanks and Regards
    Srikanth.P
    Edited by: SRIKANTH P on Jun 4, 2009 2:33 PM

  • How to make use of adjacent data elements within the same buffer

    Hi,
             Does anyone know how to make use of adjacent data elements within the same buffer? To make my question clearly, I would like to give you an example. In my application, I set "sample to read" as 10 which means at each loop 10 data samples will be taken into a buffer. Now, what I would like to do is to do some calculations on adjacent data samples in same buffer. I tried to use "shift register" for this, but it seemed to me that it only can deal with the calculation between data from adjacent loops. In other words, it skips 9 data elements and take the 10th one for the calculation.
             Here I also attach my VI showing what I did.
        Thank you very much in advance,
                            Suksun
    Attachments:
    wheel_encoder_1.vi ‏98 KB

    Hi Suksun,
          I hope you'll forgive me for distilling your code - mainly to understand it better.  I tried to duplicate your logic exactly - which required reversing the "derivatives"-array before concatination with the current samples array.  As in your code, the last velocity is being paired with the first position.  If first velocity is really supposed to be paired with first position, just remove the "Reverse 1D Array" node.
    cheers
    Message Edited by Dynamik on 01-07-2006 03:17 AM
    Message Edited by Dynamik on 01-07-2006 03:19 AM
    When they give imbeciles handicap-parking, I won't have so far to walk!
    Attachments:
    encoder2.GIF ‏14 KB
    encoder2.vi ‏102 KB

  • Query to get the data of all the columns in a table except any one column

    Can anyone please tell how to write a query to get the data of all the columns in a table except one particular column..
    For Example:
    Let us consider the EMP table.,
    From this table except the column comm all the remaining columns of the table should be listed
    For this we can write a query like this..
    Select empno, ename, job, mgr, sal, hiredate, deptno from emp;
    Just to avoid only one column, I mentioned all the remaining ( 7 ) columns of the table in the query..
    As the EMP table consists only 8 columns, it doesn't seem much difficult to mention all the columns in the query,
    but if a table have 100 columns in the table, then do we have to mention all the columns in the query..?
    Is there any other way of writing the query to get the required result..?
    Thanks..

    Your best best it to just list all the columns. Any other method will just cause more headaches and complicated code.
    If you really need to list all the columns for a table because you don't want to type them, just use something like...
    SQL> ed
    Wrote file afiedt.buf
      1  select trim(',' from sys_connect_by_path(column_name,',')) as columns
      2  from (select column_name, row_number() over (order by column_id) as column_id
      3        from user_tab_cols
      4        where column_name not in ('COMM')
      5        and   table_name = 'EMP'
      6       )
      7  where connect_by_isleaf = 1
      8  connect by column_id = prior column_id + 1
      9* start with column_id = 1
    SQL> /
    COLUMNS
    EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,DEPTNO
    SQL>

  • Creation of internal table dynamically based on the Date Range entered

    Hi SAPgurus,
    I have been facing one issue i.e creation of internal table dynamically based on the date range entered in the selection screen. For example the date range I am giving as 06/2006 to 08/2006, it should display the Fieldcatelog dynamically, this part i have completed but the only issue I am facing is to populate the sales data into that fields.
    Right now my program is displaying the ALV like this.
    Ex:
    <b>CSR    District   06/2006  07/2006  08/2006  totals</b>      
    Shiva      New York                             10.00
    Shiva      new york                             30.00
    Shiva      new york                             40.00
    but it should display like this
    <b>CSR    District 06/2006 07/2006 08/2006 totals</b>
    Shiva  New York  10.00   30.00 40.00
    80.00                 
    Please help me in this scenario, how to acheive like this..
    Thanks & Regards,
    Sivaram Kandula

    Hi Sivaram,
                 I also got the same requirement . i saw rich and your code whatever you have uploaded.i have created dynamic internal table but i am facing the issue to populating the data to my dynamic internal table.
    Sivaram, can you please explain your code after this.
    *<dyn_table>
    *tab_item.
      LOOP AT tab_item.
        ASSIGN COMPONENT 1 OF STRUCTURE <dyn_wa> TO <dyn_table>.
        ASSIGN COMPONENT 2 OF STRUCTURE <dyn_wa> TO <dyn_table>.
    *    <dyn_wa> = tab_item-bztxt.
    *    <dyn_wa> = tab_item-total.
    *    APPEND <dyn_wa> TO <dyn_table>.
    **    <dyn_wa> = tab_item-total.
    **    ASSIGN tab_item-bezei  TO <dyn_wa>.
    *  APPEND <dyn_table>.
      ENDLOOP.
    how you are puting the loop at tab_item. but tab_item is already commented.
    can you send me the code after that.
    i am sending some part of my code.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
       EXPORTING
         it_fieldcatalog = gt_fCAT1
       IMPORTING
         ep_table        = new_table.
    ASSIGN new_table->* TO <dyn_table>.
       create data new_line like line of <dyn_table>.
       assign new_line->* to <dyn_wa>.
    select vbeln
            fkart
            vkorg
            vtweg
            fkdat
            spart
            fksto
            from vbrk
            client specified
            into table gt_vbrk
            where mandt = sy-mandt
            and fkart in ('ZF5','ZFR')
            and vkorg = '1100'
            and vtweg = '20'
            and fkdat in s_fkdat
            and spart = '06'
            and fksto = ' '.
       if gt_vbrk[] is not initial.
      select  vbeln
              fkimg
              prsdt
              netwr
              matnr
              arktx
              werks
              mwsbp
              from vbrp
              client specified
              into table gt_vbrp
              for all entries in gt_vbrk
              where vbeln = gt_vbrk-vbeln
              and werks in s_werks
              and matnr in s_matnr.
      endif.
    select mnr ltx spras from t247
    into table it_t247
    where spras = 'E'.
    data: lv_month1 type vbrp-prsdt,
           name1(3) type c,
           s_month type string,
            s_month1 type string,
             s_month2 type string.
    *      lv_netwr1 type vbrp-netwr,
    *          lv_mwsbp1 type vbrp-mwsbp.
          loop at gt_vbrp into gs_vbrp.
            gs_final2-matnr = gs_vbrp-matnr.
            gs_final2-arktx = gs_vbrp-arktx.
            gs_final2-fkimg = gs_vbrp-fkimg.
           lv_month1 = gs_vbrp-prsdt.
            read table it_t247 into wa_t247 with key mnr = lv_month1+4(2).
            if sy-subrc eq 0.
            name1 =  wa_t247-ltx.
            endif.
             concatenate  name1
                       lv_month1(4) into s_month SEPARATED BY '_' .
             CONCATENATE S_MONTH 'QTY' INTO S_MONTH1 SEPARATED BY ''.
              CONCATENATE S_MONTH 'VALUE' INTO S_MONTH2 SEPARATED BY ''.
             gs_final2-month = s_month.
              lv_netwr1 = gs_vbrp-netwr.
            lv_mwsbp1 = gs_vbrp-mwsbp.
            gs_final2-MONTH_QTY = S_MONTH1.
            GS_FINAL2-MONTH_VAL = S_MONTH2.
            gs_final2-value = lv_netwr1 + lv_mwsbp1.
           append gs_final2 to gt_final2.
           clear: gs_final2. "lv_name2.
           endloop.
           if gt_final2[] is not initial.
             sort gt_final2 by matnr month ascending .
             loop at gt_final2 into gs_final2.
            gs_final2_01 = gs_final2.
         collect gs_final2_01 into gt_final2_01.
        endloop.
           endif.
       ENDIF..
    Regards
    Ankur

  • Dynamically pass the date to all the programs in a chain

    Hi,
    I have a requirement to pass the date to all the programs in the chain. The first step when the chain starts should be to calculate the next batch date from a oracle table, and then pass that date as an argument to all the programs.
    For example,
    This should be the sequence of steps once the chain has started.
    1. Start Chain
    2. Step1 - Calculate the next batch date from the oracle table.
    3. Step2 - After the successful completion of Step1, run the program with the input parameter as date which is calculated from Step1.
    4. End Chain
    Please help.

    Hi,
    The recommended way of doing this is to store tha data to be passed (in this case the date) in a table and have the other steps access it.
    If you have many chains, or the same chain used several times, you can use the job name and owner as the primary key for the table. You can then pass the job name and owner into every program as metadata arguments (see define_metadata_argument) so every step knows what job is a part of and can select the data from the table.
    Hope this helps,
    Ravi.

Maybe you are looking for