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 - Toyear issues

former_member192842
Participant
0 Likes
1,580

Dear Experts,

I have created a number range object "ZDEMO" with the following properties.

1. Subobject - J_1IEXGRPS(Excise Group)

2. To year - 'X'

3. Number length domain - NUM4

4. No interval rolling - 'X'.

5. No buffering.

Then created a interval only for the year 2012 and ExciseGroup(sub object)  - 10 as

No     Year     From     To     CurrentNo

01     2012     0001     9999     0

After creating, i called the number range through report program using the FM - "NUMBER_GET_NEXT".

For the year 2012, number range is working fine. But when i call the same number range for the year 2011, instead of throwing an error, the number range

is generated from the interval created for 2012. Year validation is not happening.

Please help me to resolve this issue.

Regards

Anand

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,422

Seems to be the standard behavior, SAP look for the first range with year greater or equal to the requested year (so the "TO YEAR" name of the field)

-> Your created range is valid til 2012 so valid for 2012, 2011, 2010, etc. but not for 2013, 2014.

* From include LSNR3F01 / in NUMBER_GET_NEXT FG

      select * from nriv where object    = p_object
                           
and subobject = p_subobject
                           
and nrrangenr = p_nr_range_nr
                           
and toyear   >= p_toyear
                    
order by primary key.                "#EC PORTABLE
         g_found
= yes.
        
exit.
     
endselect.

If you want to prohibit 2011 (and previous years) create range for 2011 with no free interval, (set current number equal to maximum number)

Regards,

Raymond

Dear Experts,

I have created a number range object "ZDEMO" with the following properties.

1. Subobject - J_1IEXGRPS(Excise Group)

2. To year - 'X'

3. Number length domain - NUM4

4. No interval rolling - 'X'.

5. No buffering.

Then created a interval only for the year 2012 and ExciseGroup(sub object)  - 10 as

No     Year     From     To     CurrentNo

01     2012     0001     9999     0

After creating, i called the number range through report program using the FM - "NUMBER_GET_NEXT".

For the year 2012, number range is working fine. But when i call the same number range for the year 2011, instead of throwing an error, the number range

is generated from the interval created for 2012. Year validation is not happening.

Please help me to resolve this issue.

Regards

Anand

5 REPLIES 5
Read only

Former Member
0 Likes
1,422

Can you remove the To year check box and check?

Read only

0 Likes
1,422

On removing the To year check box, the year option gets removed while creating the Number range interval.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,423

Seems to be the standard behavior, SAP look for the first range with year greater or equal to the requested year (so the "TO YEAR" name of the field)

-> Your created range is valid til 2012 so valid for 2012, 2011, 2010, etc. but not for 2013, 2014.

* From include LSNR3F01 / in NUMBER_GET_NEXT FG

      select * from nriv where object    = p_object
                           
and subobject = p_subobject
                           
and nrrangenr = p_nr_range_nr
                           
and toyear   >= p_toyear
                    
order by primary key.                "#EC PORTABLE
         g_found
= yes.
        
exit.
     
endselect.

If you want to prohibit 2011 (and previous years) create range for 2011 with no free interval, (set current number equal to maximum number)

Regards,

Raymond

Read only

0 Likes
1,422

Thanks for the reply. As you suggested, problem solved when the previous years was set to the maximum current number. But please do clarify, on whether this is the right way or the only solution to overcome this problem.

Read only

0 Likes
1,422

This is the correct and only way.

(the year is only a "to date", this enabled to manage year dependant range as not dependant creating a year 9999 record)

Regards,

Raymond