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

Number Range Problem

Former Member
0 Likes
882

Hi ABAPers,

I have a problem regarding the checking of my number range...this is the sample

itab i created :

DATA : it_nriv TYPE RANGE OF NRFROM WITH HEADER LINE.

under load-program , i declare this.

LOAD-OF-PROGRAM.

it_nriv-sign = 'I'.

it_nriv-option = 'CP'.

it_nriv-low = '0100000000'.

it_nriv-high = '0299999999'.

APPEND it_nriv.

the checking value is <in>-kunnr = 100000056.

so i declare this to my program

LOOP AT it_data ASSIGNING <in>.

IF <in>-kunnr(10) IN it_nriv

AND it_nriv IS NOT INITIAL.

PERFORM insert_data.

ELSE.

PERFORM insert_norange.

ENDIF.

the main problem is , everytime i pass a value for example <in>-kunnr = 100000056.

it will pass or go to perform insert_data...but unfortunately...it always goes to perform insert_norange..

What should be the problem to this syntax?

Kindly Help Me.....

Thanks in advance

aVaDuDz

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
845

hi,

for select-options we have 4 parameters in that for option we have to use poerators [relational ] like BT, IN, LIKE, EQ, NE,...........

so change t_nriv-option = 'CP'. to t_nriv-option = 'BT' or any other valid relational operator .

if useful reward some points.

with regards,

Suresh.A

7 REPLIES 7
Read only

Former Member
0 Likes
845

i think the problem is

it_nriv-sign = 'I'.

it_nriv-option = 'BT'. "instead of CP use BT

it_nriv-low = '0100000000'.

it_nriv-high = '0299999999'.

APPEND it_nriv.

regards

shiba dutta

Read only

Former Member
0 Likes
845

Hi

something wrong with the condition

IF <in>-kunnr(10) IN it_nriv

AND it_nriv IS NOT INITIAL.

just check

Change the line

it_nriv-option = 'CP'.

to

it_nriv-option = 'BT'.

and see

Since you have given CP it is not getting populated and its always going to the second condition

PERFORM insert_norange.

Reward points for useful Answers

Regards

Anji

Read only

0 Likes
845

hello Anji ,

thanks for your reply...i think the main problem is the value i pass in the program is

100000056 which is compared to 0100000000 ...now..how can i put 0 before 100000056

since the maximum length is 10 and 100000056 has only nine value..compared to 0100000000..please help

Thanks in advance

aVaDuDz

Read only

Former Member
0 Likes
846

hi,

for select-options we have 4 parameters in that for option we have to use poerators [relational ] like BT, IN, LIKE, EQ, NE,...........

so change t_nriv-option = 'CP'. to t_nriv-option = 'BT' or any other valid relational operator .

if useful reward some points.

with regards,

Suresh.A

Read only

0 Likes
845

Hi Suresh.A

Thanks so much for your reply...by the way..what is the meaning of BT ?IN? and so forth...sorry...im just a beginner in ABAP..

Thanks so much

aVaDuDz

Read only

0 Likes
845

use fm CONVERSION_EXIT_ALPHA_INPUT to get the leading zeros.

regards

shiba dutta

Read only

0 Likes
845

Thanks shiba dutta...!!!!