FUNCTION zget_number_range.
*"----------------------------------------------------------------------
*"*"本地接口:
*" IMPORTING
*" VALUE(IV_RANGE) LIKE INRI-NRRANGENR
*" VALUE(IV_OBJECT) LIKE INRI-OBJECT
*" EXPORTING
*" VALUE(EV_NUMBER)
*"----------------------------------------------------------------------
*获取流水单号,by TUS FANZHENHUI 20200922
DATA:lv_subrc TYPE sy-subrc.
lv_subrc = 1.
WHILE lv_subrc NE 0.
CALL FUNCTION 'NUMBER_RANGE_ENQUEUE'
EXPORTING
object = iv_object
EXCEPTIONS
foreign_lock = 1
object_not_found = 2
system_failure = 3
OTHERS = 4.
lv_subrc = sy-subrc.
ENDWHILE.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = iv_range
object = iv_object
IMPORTING
number = ev_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
OTHERS = 7.
CALL FUNCTION 'NUMBER_RANGE_DEQUEUE'
EXPORTING
object = iv_object
EXCEPTIONS
object_not_found = 1
OTHERS = 2.
ENDFUNCTION.
阅读(2293) | 评论(0) | 转发(0) |