‎2007 Sep 11 12:56 PM
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
‎2007 Sep 11 1: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
‎2007 Sep 11 12:58 PM
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
‎2007 Sep 11 12:58 PM
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
‎2007 Sep 11 12:59 PM
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
‎2007 Sep 11 1: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
‎2007 Sep 11 1: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
‎2007 Sep 11 1: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
‎2007 Sep 11 1: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
‎2007 Sep 12 5: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