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

SELECT-OPTION

Hi

I want to filter the data according to the inputs given by user in SELECT-OPTION.

in an select quires.

please help to know how to get the values enter by user in screen of Select-option ...is it in LOW and HIGH of SELECT-OPTION. ??

Thanks in advance

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 12:17 PM

    Hello Lokesh,

    validate the field that u are selecting from the selection statements like this in where clause...

    .....

    WHERE MATNR <b>IN</b> S_MATNR.

    Now select statement will fetch the records for only the values given in LOW and HIGH of S_MATNR.

    <b><REMOVED BY MODERATOR></b>

    Regards

    --

    Sasidhar Reddy Matli.

    Message was edited by:

    Alvaro Tejada Galindo

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 11:58 AM

    Hi,

    Refer to the following code:

    SELECT vbeln

    fkart

    fkdat

    FROM vbrk

    INTO TABLE int_vbrk

    WHERE vbeln IN s_vbeln.

    Hope this helps.

    <b><REMOVED BY MODERATOR></b>

    Regards,

    Sipra

    Message was edited by:

    Alvaro Tejada Galindo

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 11, 2007 at 11:58 AM

    Hi,

    u ahve to write the query like this irrespective of low or high.

    data : s_matnr for mara-matnr.

    select * from mara into table itab where matnr in s_matnr.

    Regards,

    Nagaraj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 11:59 AM

    if u have given SELECT-OPTIONS: A for MARA-MATNR..

    then in select query u can write the code as following.

    code no _ 1.

    select * from mara

    into table IT_MARA

    where

    matnr IN A.

    Code No 2.

    select * from mara

    into table IT_MARA

    where

    matnr >= A-LOW or

    matnr <= A-HIGH.

    but i think the Code No 1 is the best option and used by the all ABAPers....

    <b><REMOVED BY MODERATOR></b>

    Message was edited by:

    Alvaro Tejada Galindo

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 12:00 PM

    Hi,

    Here i am sending sample code for selecting the data by enetring selection screen values

    SELECT-OPTIONS : S_MATNR FOR MARA-MATNR.

    select matnr from mara into table itab where matnr = s_matnr.

    <b><REMOVED BY MODERATOR></b>

    praveen

    Message was edited by:

    Alvaro Tejada Galindo

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 12:07 PM

    hi,

    select options internally creates a internal table for u with four field

    1. low

    2. high

    3. sign

    4. option.

    for ex:

    select-options: s_vbeln like vbap-vbeln.

    in select statement u can give as

    select * from vbap into table itab where vbeln in s_vbeln.

    means that all the values u gave in select options are considered here.

    the screen which u get for select options will have again four options as

    include -


    single value or range of values

    exclude -


    single value or range of values.

    <b><REMOVED BY MODERATOR></b>

    with regards,

    Suresh Aluri.

    Message was edited by:

    Alvaro Tejada Galindo

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 11, 2007 at 12:53 PM

    Hi Lokesh..

    This is the Sample code.

    TABLES : EKKO.

    SELECT-OPTIONS: S_EBELN FOR EKKO-EBELN.

    START-OF-SELECTION.

    SELECT * FROM EKKO INTO TABLE IT_EKKO

    WHERE EBELN IN S_EBELN.

    there is no need to Fill the LOW and HIGH explicitly. The user input is automatically store in SELECT-OPTION field.

    <b><REMOVED BY MODERATOR></b>

    Message was edited by:

    Alvaro Tejada Galindo

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 12, 2007 at 04:29 AM

    Hi Lokesh,

    If you have s_matnr as your select options, all values entered on the selection screen will be considered.

    Select * into itab from mara

    where matnr in s_matnr.

    As you may know, s_matnr is a table. As described by other replies, all your inputs will be in this table.

    If you enter one value say '100' on your screen, your table has one entry

    s_matnr-low = '100'

    s_matnr-high= initial

    s_matnr-sign= 'I'

    s_matnr-option='EQ'

    Best thing to do is run your program or any SAP program with input, and enter values in the From and To and also ranges if there is one. Enter a bunch of values and then debug and examine the s_matnr table and see how the program has populated the table. Note the -sign and -option values. Best way to learn this.

    Hope this helps.

    Filler

    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.