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: 

Number Range Problem

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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

0 Kudos

use fm CONVERSION_EXIT_ALPHA_INPUT to get the leading zeros.

regards

shiba dutta

0 Kudos

Thanks shiba dutta...!!!!