Application Development 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: 

Select-options

Former Member
0 Kudos

Hi All,

I have specified two values in a select-option.

for eg dat1 to dat7

if i want all the values that fall in dat1 to dat7 in an internal table, hw can i do it?

thanks,

HM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Hitesh,

You can do like this

REPORT ZTEST .

tables: kna1.

Select-options: s_kunnr for kna1-kunnr.

Data: begin of itab occurs 0,

kunnr type kna1-kunnr,

end of itab.

Select Kunnr from kna1 into table itab where kunnr in s_kunnr.

Loop at itab.

write: / itab.

endloop.

<b>Reward Points if this helps,</b>

Satish

4 REPLIES 4

Former Member
0 Kudos

Hi Hitesh,

You can do like this

REPORT ZTEST .

tables: kna1.

Select-options: s_kunnr for kna1-kunnr.

Data: begin of itab occurs 0,

kunnr type kna1-kunnr,

end of itab.

Select Kunnr from kna1 into table itab where kunnr in s_kunnr.

Loop at itab.

write: / itab.

endloop.

<b>Reward Points if this helps,</b>

Satish

0 Kudos

Hi,

You shud use IN operator in your select stmt as below

Select Kunnr from kna1 into table itab where kunnr IN s_kunnr.

naimesh_patel
Active Contributor
0 Kudos

Can you paste your code for the select options here? This will help us to get more idea about the master you are using.

Regards,

Naimesh Patel

Former Member
0 Kudos

Hi

By defualt it creates an Internal table(selection table) with fields <b>SIGN,OPTION,HIGH and LOW fields</b> when you declare any field as select-options

in this case if you declare date as

Select-options: <b>s_date</b> for sy-datum.

Now whatever values you enter in this low and high fields of select-options they will be stored in the internal table S_DATE.

and accordingly we use this internal table in the select query where condition as:

select* from <table> into table <itab> where date <b>IN s_date.</b>

Regards

anji