Chinaunix首页 | 论坛 | 博客
  • 博客访问: 575111
  • 博文数量: 30
  • 博客积分: 2000
  • 博客等级: 大尉
  • 技术积分: 225
  • 用 户 组: 普通用户
  • 注册时间: 2009-04-28 13:40
文章分类

全部博文(30)

文章存档

2010年(1)

2009年(29)

我的朋友

分类: 项目管理

2009-05-19 13:20:56

Number Range Object

By Suresh Kumar Parvathaneni

 Creation of a Number range object:

1.      Go to transaction SNRO (Simple way to remember is SapNumberRangeObject).

 

 

2.      Enter the number range object name and press CREATE.

3.      Enter the description, Long text and Number Length domain andWarning % as shown below:

 

 

Warning% à Assume that an interval is defined from 1 to 1000. If you want to issue a warning at the number 900, enter 10 (%) here.

4.      Press SAVE. You would get a prompt as shown below:

 

5.      Press YES and assign the object to a local class.

6.      Now click on “Number Ranges” button on the application toolbar.

 

7.      Click on “Change Intervals”.

 

 

 

8.      Click on “Insert Interval”.

9.      Enter the values as shown below:

 

10. Click “Insert” and then SAVE. The number range object is generated. 

Testing the Number Range Object: 

We can use the function module, NUMBER_GET_NEXT, to get the next number of any number range object. 

Following is a test program to get the next available number of the object created above:  

REPORT zsnro_test.

DATA:
NUMBER TYPE I.

CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
   nr_range_nr = '01'
   object = 'ZDEMO'
IMPORTING  
  NUMBER = NUMBER
EXCEPTIONS
  INTERVAL_NOT_FOUND = 1
  NUMBER_RANGE_NOT_INTERN = 2
  OBJECT_NOT_FOUND = 3
  QUANTITY_IS_0 = 4
  QUANTITY_IS_NOT_1 = 5
  INTERVAL_OVERFLOW = 6
  BUFFER_OVERFLOW = 7
  OTHERS = 8
.
IF sy-subrc <> 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Write :/ 'Next available number is: ', Number. 

阅读(741) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~