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

Doubt about RANGES

Former Member
0 Likes
1,150

Hi All.

1)i have one paramenter field like p_branch,it will allow the value only 100 to 500 so

2)i need ranges like 100 to 500 ,

3)i was created ranges like

RANGES:r_bran for zdbt-field1.

4)and i was maintain those value in table TVARVC.now i want check IF condition like IF p_branch in r_ban.

5)r_ban fetch all parameter perfectly(low ,high ,sign ,option) but i cant check if codition.

i have done following code....

IF p_branch in r_ban.

message 'ranges between 100 to 500' type 's'.

else.

message ' No ranges between 100 to 500' type 's'.

endif.

if i entred 200 in input field p_branch ,i would need message like ' No ranges between 100 to 500' but i got as 'ranges between 100 to 500' type 's'.

please help me.

regards.

jay

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,123

HI,

Cant understand your problem?

Since 200 is in the range 100 to 500, it gives you the message 'ranges between 100 to 500'.

Correct only, is it not?

Regards

Subramanian

Hi All.

1)i have one paramenter field like p_branch,it will allow the value only 100 to 500 so

2)i need ranges like 100 to 500 ,

3)i was created ranges like

RANGES:r_bran for zdbt-field1.

4)and i was maintain those value in table TVARVC.now i want check IF condition like IF p_branch in r_ban.

5)r_ban fetch all parameter perfectly(low ,high ,sign ,option) but i cant check if codition.

i have done following code....

IF p_branch in r_ban.

message 'ranges between 100 to 500' type 's'.

else.

message ' No ranges between 100 to 500' type 's'.

endif.

if i entred 200 in input field p_branch ,i would need message like ' No ranges between 100 to 500' but i got as 'ranges between 100 to 500' type 's'.

please help me.

regards.

jay

12 REPLIES 12
Read only

Former Member
0 Likes
1,123

Hi,

200 is in between the range of 100 and 500..

Then what is the issue??

Thanks,

Naren

Read only

0 Likes
1,123

sorry narendar.....

i got message like "No ranges between 100 to 500." i dont know where i have problem.

please help me. review code ,is it correct?

regards.

jay

Read only

0 Likes
1,123

See the following ex: it is working

tables: vbap.

parameters:p_posnr like vbap-posnr.

select-options: s_posnr for vbap-posnr.

initialization.

s_posnr-sign = 'I'.

s_posnr-option = 'EQ'.

s_posnr-low = 1.

s_posnr-high = 10.

append s_posnr.

start-of-selection.

loop at s_posnr.

if ( p_posnr >= s_posnr-low and

p_posnr <= s_posnr-high ).

write:/ 'yes'.

exit.

endif.

endloop.

Read only

0 Likes
1,123

Check whether u have specified like

RANGES: r_bran for zdbt-field1.

r_bran-sign = 'I'.             "Exclude 
r_bran-option = 'BT'.         "Pattern 
r_bran-low = 100.            "Low Value 
r_bran-high = 500.                "High Value 
append r_bran.

IF p_branch IN r_ban.
message s000 WITH 'ranges between 100 to 500'.
else.
message s000 WITH ' No ranges between 100 to 500'. 
endif.

Hope this is clear.

Read only

Former Member
0 Likes
1,124

HI,

Cant understand your problem?

Since 200 is in the range 100 to 500, it gives you the message 'ranges between 100 to 500'.

Correct only, is it not?

Regards

Subramanian

Read only

0 Likes
1,123

sorry subramani......

i got message like "No ranges between 100 to 500." i dont know where i have problem.

please help me. review code ,is it correct?

regards.

jay

Read only

Former Member
0 Likes
1,123

loop at r_ban.

if ( p_branch >= r_ban-low and

p_branch <= r_ban-high ).

write:/ 'yes'.

exit.

endif.

endloop.

Read only

Former Member
0 Likes
1,123

Hi,

In the ranges..What did you populate..

Check if you have the following values in the range..

SIGN = 'I'.

OPTION = 'BT'.

LOW = '100'.

HIGH = '500'.

If you populate the range like the above..It will work..

Thanks,

Naren

Read only

0 Likes
1,123

Thanks all.

I got solution.............

Read only

Former Member
0 Likes
1,123

Hi Jay ,

Is the length to be specific data type of zdbt-field1 and p_branch the same.

Just debug and see how are the values stored in p_branch and the range.

Regards

Arun

Read only

Former Member
0 Likes
1,123

thanks all

Read only

Former Member
0 Likes
1,123

Hi,

Please make sure to reward points for helpful answers...And close the thread if the problem is solved..

Thanks,

Naren