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

Ranges

Former Member
0 Likes
396

Hi evryone,

The below code am using ranges.It is executing well when there is LOW and HIGH values for p1.But if i give only P1-LOW in the input then am not getting the output.Please Help.

Vijay

SELECT-OPTIONS: p1 FOR v_p1 OBLIGATORY.

RANGES:r1 for v_p1.

START-OF-SELECTION.

read table p1 index 1.

r1-sign = 'I'.

r1-option = 'EQ'.

while p1-low LE p1-high.

r1-low = p1-low.

append r1.

p1-low = p1-low + 1.

endwhile.

WHEN 1.

t_power_cost_p1-power_cost_p1_apr

= t_power_cost_p1-power_cost_p1_apr + it_faglflext-hsl01.

WHEN 2.

t_power_cost_p1-power_cost_p1_may

= t_power_cost_p1-power_cost_p1_may + it_faglflext-hsl02.

WHEN 3.

t_power_cost_p1-power_cost_p1_jun

= t_power_cost_p1-power_cost_p1_jun + it_faglflext-hsl03.

WHEN 4.

t_power_cost_p1-power_cost_p1_jul

= t_power_cost_p1-power_cost_p1_jul + it_faglflext-hsl04.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
383

Hi,

That's because p1-high is initial. I suggest you to default p1-high to 16 when it is initial. Check below code.

START-OF-SELECTION.

read table p1 index 1.

r1-sign = 'I'.

r1-option = 'EQ'.

IF p1-high IS INITIAL.

p1-high = 16.

ENDIF.

while p1-low LE p1-high.

r1-low = p1-low.

append r1.

p1-low = p1-low + 1.

endwhile.

1 REPLY 1
Read only

Former Member
0 Likes
384

Hi,

That's because p1-high is initial. I suggest you to default p1-high to 16 when it is initial. Check below code.

START-OF-SELECTION.

read table p1 index 1.

r1-sign = 'I'.

r1-option = 'EQ'.

IF p1-high IS INITIAL.

p1-high = 16.

ENDIF.

while p1-low LE p1-high.

r1-low = p1-low.

append r1.

p1-low = p1-low + 1.

endwhile.