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

Regarding Ranges

Former Member
0 Likes
718

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.

8 REPLIES 8
Read only

Former Member
0 Likes
690

Hi,

Did you use 'IN' in your select query?

Read only

Former Member
0 Likes
690

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.

Read only

Former Member
0 Likes
690

s , also not working

Read only

0 Likes
690

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

Read only

matt
Active Contributor
0 Likes
690

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.

Read only

Former Member
0 Likes
690

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

Read only

former_member778253
Active Participant
0 Likes
690

just, check the select options declaration which should be as follows:

s_kstar for <tablename>-<fieldname>

hope this works.

Read only

Former Member
0 Likes
690

helpful