Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

IN operator

Former Member
0 Likes
751

what does IN operator do?what is its importance in select statement?

6 REPLIES 6
Read only

Former Member
0 Likes
723

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  ' '  .

Read only

0 Likes
723

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*

Read only

Former Member
0 Likes
723

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.

Read only

Former Member
0 Likes
723

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

Read only

Former Member
0 Likes
723

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

Read only

Former Member
0 Likes
723

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