‎2009 Dec 22 7:22 AM
Hi all,
INITIALIZATION.
S_KSTAR-SIGN = 'I'.
S_KSTAR-OPTION = 'BT'.
S_KSTAR-LOW = '600000'.
S_KSTAR-HIGH = '699999'.
APPEND S_KSTAR.
S_KSTAR-SIGN = 'I'.
S_KSTAR-OPTION = 'BT'.
S_KSTAR-LOW = '400000'.
S_KSTAR-HIGH = '499999'.
APPEND S_KSTAR.
Through initialization i have appended two ranges for select option but when i am retrieving data from select statement it's taking only one range which is in header line. Please help me how to retrive data between two data ranges.
Thanks & Regards,
Nagalakshmi.
‎2009 Dec 22 7:25 AM
‎2009 Dec 22 7:28 AM
have you used IN or equal to in where clause ?
if You had used equal to then you data will be fetched based on header if it is not cleared else no data will come.
then try using IN instead of equal to.
‎2009 Dec 22 7:28 AM
‎2009 Dec 22 7:50 AM
You have to adress table's body not header line
"correct one
select ....
where ... IN S_KSTAR[].
"wrong one
select ...
where ... IN S_KSTAR.
This should help
Regards
Marcin
‎2009 Dec 22 9:03 AM
If it is defined as a select option, the [] is not required.
This works:
TABLES t100.
DATA: t_100 TYPE STANDARD TABLE OF t100,
wa_100 TYPE t100.
SELECT-OPTIONS: s_msg FOR t100-msgnr.
INITIALIZATION.
s_msg-option = 'BT'.
s_msg-sign = 'I'.
s_msg-low = '020'.
s_msg-high = '030'.
APPEND s_msg.
s_msg-low = '120'.
s_msg-high = '130'.
APPEND s_msg.
START-OF-SELECTION.
SELECT * FROM t100 INTO TABLE t_100 WHERE sprsl EQ 'EN'
AND arbgb EQ '00'
AND msgnr IN s_msg.
END-OF-SELECTION.
LOOP AT t_100 INTO wa_100.
WRITE: / wa_100-msgnr.
ENDLOOP.So the question is: how have you defined s_kstar, what is your select statement? If s_kstar is defined as a select-option, or via the RANGES statement, then it DOES NOT use the header in the selection.
‎2009 Dec 22 7:34 AM
Make a seperate range table for the two condition and try.
It should work when you use two diff range tables.
Also, check the avaliability of data between these two ranges.
Edited by: Harsh Bhalla on Dec 22, 2009 1:14 PM
‎2009 Dec 22 9:09 AM
just, check the select options declaration which should be as follows:
s_kstar for <tablename>-<fieldname>
hope this works.
‎2011 Apr 19 10:57 AM