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: 

Help needed in Ranges ?

Former Member
0 Kudos

Hi,

Plz help me to understand this.

RANGES: r_rangename FOR konv-kposn.

**********

INITIALIZATION.

r_rangename-sign = 'I'

r_rangename-option = 'EQ'.

r_rangename-low = space.

Append r_rangename.

Clear r_rangename.

***************************

SELECT * INTO TABLE itab

FROM konv

WHERE

knumv = '32424234' "Some Value

kposn IN r_rangename

AND stunr IN r_rangename

AND zaehk IN r_rangename.

********************************************

i am not able to understand this ranges concept.

This select query is not getting executed and i am getting a sy-subrc value of 4.

The data is present in the table konv for the given value of knumv.

Please Help !!...

Regards.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Don't populate anything into the range ..

By default U'll get every thing from the table(if range is initial then

every thing is considered)

6 REPLIES 6

ThomasZloch
Active Contributor
0 Kudos

r_rangename-low = space.

you're not providing a valid condition number here, so subrc is 4. once you provide valid numbers in the range, your query will return results.

A range is basically the same as a select-option on the selection screen.

Cheers

Thomas

Former Member
0 Kudos

Don't populate anything into the range ..

By default U'll get every thing from the table(if range is initial then

every thing is considered)

0 Kudos

Pls try without r_rangename-low = space.

Former Member
0 Kudos

Hi,

Ranges are exactly similar to select-options, with no input box on the selection screen. These can be used in select statement in the where condition to get records for multiple values.

In your query, the range has a single record with null value as range-low. so the system finds all records with KPOSN,STUNR,ZAEHK is initial. Because, there are no records in the system, it is not fetching any value, hence setting sy-subrc to 4. Hope this helps, <REMOVED BY MODERATOR>

rgds,

Harikrishna.

Edited by: Alvaro Tejada Galindo on Feb 15, 2008 3:05 PM

Former Member
0 Kudos

Hi,

you are populating the ranges table in initialization event.

the ranges are declared for kposn field.

In where condition of the select you are equating to stunr, zaehk also.

That is why you are not getting sy-subrc as zero.

write start-of-selection. befor the select statement also.

regards,

kamala.

Former Member
0 Kudos

If you dont want to pass the value to the ranges just skip.

try this:

r_rangename-sign = 'I'.

r_rangename-option = 'EQ'.

*r_rangename-low = space.

Append r_rangename.

Clear r_rangename.