CA Function module Used the same way in S/4HANA

NUMBER_GET_NEXT Get Next Number from Number Range

Assigns the next free number from an internal number range interval of a number range object (maintained in SNRO/SNUM). Custom programs and custom tables use it to create unique document or record numbers. Pass the object, interval (NR_RANGE_NR) and, if the object uses them, sub-object and fiscal year; check RETURNCODE, because a value other than space signals that the interval is close to or at its limit.

Function group
SNR3
Remote-enabled (RFC)
No
Type
Function module

Importing parameters

ParameterTypeDescriptionRequired
NR_RANGE_NRINRI-NRRANGENRNumber range intervalYes
OBJECTINRI-OBJECTNumber range objectYes
QUANTITYINRI-QUANTITYNumber of numbers requested—
SUBOBJECT—Sub-object value—
TOYEARINRI-TOYEARFiscal year—
IGNORE_BUFFER—Ignore number range buffering—

Exporting parameters

ParameterTypeDescription
NUMBER—Next free number
QUANTITYINRI-QUANTITYNumber of numbers assigned
RETURNCODEINRI-RETURNCODEReturn code

Exceptions

  • INTERVAL_NOT_FOUND — Interval not found
  • NUMBER_RANGE_NOT_INTERN — Number range is not internal
  • OBJECT_NOT_FOUND — Number range object not defined
  • QUANTITY_IS_0 — Requested quantity must be greater than 0
  • QUANTITY_IS_NOT_1 — Requested quantity must be 1
  • INTERVAL_OVERFLOW — Interval used up
  • BUFFER_OVERFLOW — Buffer is full

Call template (ABAP)

A skeleton generated from the interface. It lists mandatory importing parameters, exporting parameters and tables; declare the variables with suitable types in your own program.

CALL FUNCTION 'NUMBER_GET_NEXT'
  EXPORTING
    nr_range_nr = lv_nr_range_nr
    object = lv_object
  IMPORTING
    number = lv_number
    quantity = lv_quantity
    returncode = lv_returncode
  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.

Related tables

Can't find the report you need?

We also build anything that is not in the catalog. Describe it briefly and we will suggest the right solution.

Request a custom report