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

Select query for Select options.- Very Urgent- To be completed NOW!!

Hi friends,

I have a selection screen with 3 fields and ranges for all the fields i.e, low and high for all the fields.

I have to specify select queries for different conditions like when the user enters 1 input and other 2 blank and so on. This wouls also include the condition if the user enters only low or high values for any input fields. Please give me an example where such select queries are there for select options

Many Thanks,

Srilakshmi B

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Jan 31, 2008 at 04:48 AM

    Ranges on the screen means you are using SELECt OPTIONS.

    in that case just use IN clause.

    select-option: s_matnr type matnr.

    Select * from Mara inti table t_mara where matnr in S_MATNR.

    Regards,

    Amit

    Reward all helpful replies.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 05:01 AM

    Hi Srilakshmi,

    Whenever you use range in the slection screen, You can check the field by using IN operator , so that it checks in both the Low and High values.

    Reward If Useful.

    Regards,

    Chitra

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 05:03 AM

    Hi,

    For checking all these conditions, Just u can use the IN operator. It works for all these conditions.

    Ex.

    SELECT pernr ename kostl orgeh begda endda FROM pa0001

    INTO CORRESPONDING FIELDS OF TABLE int_emp WHERE persg = '3' AND

    pernr IN s_pernr AND

    kostl IN s_kostl AND

    orgeh IN s_orgeh AND

    abkrs IN s_abkrs AND

    begda <= ra_daterange-high AND

    endda >= ra_daterange-high.

    Here, s_pernr, s_kostl, s_orgeh, s_abkrs are the select options with ranges.

    Reward points if useful

    Cheers,

    Shanthi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 06:16 AM

    Srilakshmi,

    Suppose you have below select-optins

    SELECT-OPTIONS : s_date1 FOR sy-datum,

    s_date2 FOR sy-datum,

    s_date3 FOR sy-datum.

    AT SELECTION-SCREEN.

    IF NOT s_date1[] IS INITIAL AND

    s_date2[] IS INITIAL AND

    s_date3[] IS INITIAL.

    ELSEIF s_date1[] IS INITIAL AND

    NOT s_date2[] IS INITIAL AND

    s_date3[] IS INITIAL..

    ELSEIF s_date1[] IS INITIAL AND

    s_date2[] IS INITIAL AND

    NOT s_date3[] IS INITIAL.

    ENDIF.

    IF you want range level conditions.

    IF NOT s_date1-low IS INITIAL AND

    s_date1-high IS INITIAL.

    ENDIF.

    According to your requirement you can write whereever you want.

    Don't foget to reward if useful...

    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.