SAP OIU_GET_NEXT_SYS_NO Function Module for Get next number for a SYS-NO in a specific table









OIU_GET_NEXT_SYS_NO is a standard oiu get next sys no SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Get next number for a SYS-NO in a specific table processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for oiu get next sys no FM, simply by entering the name OIU_GET_NEXT_SYS_NO into the relevant SAP transaction such as SE37 or SE38.

Function Group: OIU_COMMON
Program Name: SAPLOIU_COMMON
Main Program: SAPLOIU_COMMON
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function OIU_GET_NEXT_SYS_NO pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'OIU_GET_NEXT_SYS_NO'"Get next number for a SYS-NO in a specific table
EXPORTING
TABNAME = "Table name
* SUBOBJECT = "Number range object subobject value
* TOYEAR = "To fiscal year

IMPORTING
SYS_NO = "System Number

EXCEPTIONS
TABLE_NOT_FOUND = 1 OBJECT_NOT_FOUND = 2 INTERVAL_NOT_FOUND = 3 NUMBER_RANGE_NOT_INTERN = 4 INTERVAL_OVERFLOW = 5 SYS_NO_NOT_ASSIGNED = 6
.



IMPORTING Parameters details for OIU_GET_NEXT_SYS_NO

TABNAME - Table name

Data type: TABNAME
Optional: No
Call by Reference: No ( called with pass by value option)

SUBOBJECT - Number range object subobject value

Data type: NRSOBJ
Optional: Yes
Call by Reference: No ( called with pass by value option)

TOYEAR - To fiscal year

Data type: NRYEAR
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for OIU_GET_NEXT_SYS_NO

SYS_NO - System Number

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

TABLE_NOT_FOUND - table not found in OIU_CM_SN_NR

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

OBJECT_NOT_FOUND - Object not defined in TNRO

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

INTERVAL_NOT_FOUND - Interval not found

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NUMBER_RANGE_NOT_INTERN - number range not intern (NUMBER_GET_NEXT)

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

INTERVAL_OVERFLOW - Interval used up. Change not possible.

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

SYS_NO_NOT_ASSIGNED - Next system number not assigned

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for OIU_GET_NEXT_SYS_NO Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lv_sys_no  TYPE STRING, "   
lv_tabname  TYPE TABNAME, "   
lv_table_not_found  TYPE TABNAME, "   
lv_subobject  TYPE NRSOBJ, "   
lv_object_not_found  TYPE NRSOBJ, "   
lv_toyear  TYPE NRYEAR, "   
lv_interval_not_found  TYPE NRYEAR, "   
lv_number_range_not_intern  TYPE NRYEAR, "   
lv_interval_overflow  TYPE NRYEAR, "   
lv_sys_no_not_assigned  TYPE NRYEAR. "   

  CALL FUNCTION 'OIU_GET_NEXT_SYS_NO'  "Get next number for a SYS-NO in a specific table
    EXPORTING
         TABNAME = lv_tabname
         SUBOBJECT = lv_subobject
         TOYEAR = lv_toyear
    IMPORTING
         SYS_NO = lv_sys_no
    EXCEPTIONS
        TABLE_NOT_FOUND = 1
        OBJECT_NOT_FOUND = 2
        INTERVAL_NOT_FOUND = 3
        NUMBER_RANGE_NOT_INTERN = 4
        INTERVAL_OVERFLOW = 5
        SYS_NO_NOT_ASSIGNED = 6
. " OIU_GET_NEXT_SYS_NO




ABAP code using 7.40 inline data declarations to call FM OIU_GET_NEXT_SYS_NO

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

 
 
 
 
 
 
 
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!