Skip to Content
author's profile photo Former Member
Former Member

Ranges

Hi,

I am displaying my result in an ALV and i have give 2 option in a screen datefrom and dateto.

i am using ranges to capture data in the fields DATEFROM nd DATETO, now wat i have to do is i have to display all the data that is between these 2 dates.

My select querie is

SELECT * INTO TABLE ITAB FROM Zx_OPR WHERE DATBE IN DATBE_303 AND DATEN IN DATEN_303.

My select querie is not working !

Regards.

Add a comment
10|10000 characters needed characters exceeded

Related questions

7 Answers

  • Posted on Dec 13, 2005 at 09:41 AM

    Hi

    PL change it to

    SELECT * INTO TABLE ITAB FROM Zx_OPR WHERE DATBE between DATBE_303 AND DATEN IN DATEN_303.

    Regards,

    Suresh Datti

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 13, 2005 at 09:44 AM

    hi,

    it's not usual to use ranges when db-table has begin and end-date because of crossing of the ranges!

    normally you've to use a single date and your query should be:

    SELECT * INTO TABLE ITAB 
           FROM Zx_OPR
           WHERE DATBE le p_date AND DATEN ge p_date.

    regards Andreas

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Andreas,

      my ztable has the option of 2 date ranges and hence i have to give the option.

      but as per all the replies i got, my select querie does not gives me the right output infact no output.

      Regards

  • author's profile photo Former Member
    Former Member
    Posted on Dec 13, 2005 at 09:46 AM

    Hi Aima,

    The correct select statement is :

    SELECT * INTO TABLE ITAB FROM Zx_OPR WHERE DATBE IN DATBE_303.

    Reward points if it helps you.

    Regards,

    Sudhakar.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 13, 2005 at 09:47 AM

    are you sure you want to have range for date from and another range for date to

    why not simply use two parameters or a single select option to get the date from and to ?

    Regards

    Raja

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 13, 2005 at 09:52 AM

    select *

    into table itab

    from ZX_OPR

    where DATBE GE DATBE_303

    and DATEN LE DATEN_303.

    try this......

    hope it helps...

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 13, 2005 at 09:53 AM
    select *
    into table itab
    from ZX_OPR
    where DATBE GE DATBE_303
    and DATEN LE DATEN_303.
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 13, 2005 at 10:25 AM

    Hi Aima,

    Use the below sample code.

    RANGES r_date FOR zx_opr-date.

    INIITILIZATION.

    r_date-low = datefrom.

    r_date-high = dateto.

    r_date-sign = 'I'.

    r_date-option = 'BT'.

    APPEND r_date.

    then use

    SELECT * INTO TABLE ITAB FROM Zx_OPR WHERE DATBE IN r_date AND DATEN IN r_date.

    Hope this will solve your problem.

    Regards,

    Abdul

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.