11-20-2007 5:45 PM
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
11-20-2007 5:55 PM
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
11-20-2007 5:55 PM
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
11-20-2007 6:41 PM
Hi,
You shud use IN operator in your select stmt as below
Select Kunnr from kna1 into table itab where kunnr IN s_kunnr.
11-20-2007 6:56 PM
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
11-20-2007 7:05 PM
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