‎2008 May 02 2:07 PM
what does IN operator do?what is its importance in select statement?
‎2008 May 02 2:08 PM
hi,
if u declare input field in select-options you will use in is select statement
SELECT-OPTIONS : LIFNR FOR ZGATEPASSHDR-LIFNR.
SELECT A~GEXNO A~MJAHR A~WERKS A~LIFNR A~ERDAT
A~PURPET A~KOSTL A~REPNAM A~RETBL
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM ZGATEPASSHDR AS A INNER JOIN
ZGEPLANT AS B ON
A~CLIENT = B~MANDT AND
A~GEXNO = B~MBLNR
WHERE A~WERKS = WERKS AND
*A~LIFNR IN LIFNR AND
* b~gexno in gexno
B~MBLNR IN GEXNO AND
B~ERDAT IN ERDAT AND
* b~xblnr = ' ' AND
A~DELGP EQ ' ' .
‎2008 May 02 2:40 PM
whenever u use select options u have to use IN operator in select options
eq: select-options: so_matnr type mara-matnr.
*select * from mara into table itab where matnr IN so_matnr*
‎2008 May 02 2:46 PM
selection-option : s_matnr for mara-matnr.
when you enter 1 to 100 in the material number selection screen.
select * from mara into table itab where matnr in s_matnr.
here it will check the ranges of material 1 to 100.
IN Means
select the material from mara where material in between 1 to 100.
‎2008 May 02 2:46 PM
Hi,
IN Operator is similar to Between Operator in SQL.
It makes Select statement to fetch data between a range.
Hope U understand.
Thanks,
Swetha
‎2008 May 02 2:58 PM
SELECT *
INTO TABLE itab
FROM ztable
WHERE customer = p_customer
AND payment_status IN ('01','02').
here u will get all the data from ztable where payment_status = 01
and all the data from ztable where payment_status = 02.
hope this helps
regds
Edited by: BrightSide on May 2, 2008 2:59 PM
‎2008 May 02 3:24 PM
Hi,
We use IN when we need to select data with select-options and ranges.
Select-options and ranges have the structure:
Sign
Option
Low
High
Sign can be I (include of selection) and E (Exclude of selection)
Option can be EQ, NE, GT, GE, LT, LE, BT...
Select-options and ranges are internal tables, so they have many occurs.
Regards,
Fernando