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

loop where range

Former Member
0 Likes
8,103

Hello,

i´m executing a simple loop using a range in the where condition.

eg. loop at itab into wa_tab

where racct in r_range.

Values in r_range are

sign - 'I'

option 'EQ'

low '0000311001'

high '0000315004'

The loop only finds the 'low' entry and then ends although both numbers are in the itab. If I change option to 'BT' the loop will find all those numbers between low and high.

What am i overlooking?

Thank you,

Kevin

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,540

EQ is intended for single values - 000311001 only or 000315004 only.

BT is intended for values with a "distance" between them.

7 REPLIES 7
Read only

Former Member
0 Likes
3,541

EQ is intended for single values - 000311001 only or 000315004 only.

BT is intended for values with a "distance" between them.

Read only

0 Likes
3,540

Thanks John,

Of course, (It´s getting late..)

Read only

Former Member
0 Likes
3,540

Put 'BT' instead of 'EQ in the option of range type.

Cheers,

Satya

Read only

0 Likes
3,540

Do you want it to find those values only? Then you must add both of the values to the range table like so.



range-sign = 'I'.
range-option = 'EQ'.
range-low = '0000311001'.
append range.

range-sign = 'I'.
range-option = 'EQ'.
range-low = '0000315004'.
append range.

Here you are specifying single values. You only want when you get a hit for 311001 or 315004.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
3,540

If you want only the two records, you need the following in your table:

sign - 'I'
option 'EQ'
low '0000311001'
append r_range.

sign - 'I'
option 'EQ'
low '0000315004'
append r_range.

Rob

Read only

Former Member
0 Likes
3,540

If you don't want range and need more single selection append individual entry to range with 'EQ' Option.

Read only

Former Member
0 Likes
3,540

Kevin,

Best option is :

1. Create Ranges

2. Use <b>Ranges in the Database Selection</b> instead at Internal Table Validation.

Example:

select * from MKPF into table itab where mblnr in r_range.

Thanks

Kam

Message was edited by: Kam

Message was edited by: Kam