SAP GET_NEXT_NUMBERS Function Module for









GET_NEXT_NUMBERS is a standard get next numbers SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 get next numbers FM, simply by entering the name GET_NEXT_NUMBERS into the relevant SAP transaction such as SE37 or SE38.

Function Group: FTOOL_STRNUM
Program Name: SAPLFTOOL_STRNUM
Main Program: SAPLFTOOL_STRNUM
Appliation area: F
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function GET_NEXT_NUMBERS 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 'GET_NEXT_NUMBERS'"
EXPORTING
I_OBJECT = "
I_KEY1 = "Reorganization-Relevant Key
I_KEY2 = "Additional Key
* I_COUNT_NUMBER = 1 "
* I_XREORG = 'X' "
* I_REORG_DAYS = 360 "

IMPORTING
E_FIRST_NUMBER = "
E_LAST_NUMBER = "
E_CURRENT_NUMBER = "

EXCEPTIONS
FOREIGN_LOCK = 1
.



IMPORTING Parameters details for GET_NEXT_NUMBERS

I_OBJECT -

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

I_KEY1 - Reorganization-Relevant Key

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

I_KEY2 - Additional Key

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

I_COUNT_NUMBER -

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

I_XREORG -

Data type: BOOLE-BOOLE
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_REORG_DAYS -

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

EXPORTING Parameters details for GET_NEXT_NUMBERS

E_FIRST_NUMBER -

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

E_LAST_NUMBER -

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

E_CURRENT_NUMBER -

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

EXCEPTIONS details

FOREIGN_LOCK -

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

Copy and paste ABAP code example for GET_NEXT_NUMBERS 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_i_object  TYPE DFPM_NUMB-OBJECT, "   
lv_foreign_lock  TYPE DFPM_NUMB, "   
lv_e_first_number  TYPE N, "   
lv_i_key1  TYPE DFPM_NUMB-KEY1, "   
lv_e_last_number  TYPE N, "   
lv_i_key2  TYPE DFPM_NUMB-KEY2, "   
lv_e_current_number  TYPE N, "   
lv_i_count_number  TYPE I, "   1
lv_i_xreorg  TYPE BOOLE-BOOLE, "   'X'
lv_i_reorg_days  TYPE I. "   360

  CALL FUNCTION 'GET_NEXT_NUMBERS'  "
    EXPORTING
         I_OBJECT = lv_i_object
         I_KEY1 = lv_i_key1
         I_KEY2 = lv_i_key2
         I_COUNT_NUMBER = lv_i_count_number
         I_XREORG = lv_i_xreorg
         I_REORG_DAYS = lv_i_reorg_days
    IMPORTING
         E_FIRST_NUMBER = lv_e_first_number
         E_LAST_NUMBER = lv_e_last_number
         E_CURRENT_NUMBER = lv_e_current_number
    EXCEPTIONS
        FOREIGN_LOCK = 1
. " GET_NEXT_NUMBERS




ABAP code using 7.40 inline data declarations to call FM GET_NEXT_NUMBERS

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.

"SELECT single OBJECT FROM DFPM_NUMB INTO @DATA(ld_i_object).
 
 
 
"SELECT single KEY1 FROM DFPM_NUMB INTO @DATA(ld_i_key1).
 
 
"SELECT single KEY2 FROM DFPM_NUMB INTO @DATA(ld_i_key2).
 
 
DATA(ld_i_count_number) = 1.
 
"SELECT single BOOLE FROM BOOLE INTO @DATA(ld_i_xreorg).
DATA(ld_i_xreorg) = 'X'.
 
DATA(ld_i_reorg_days) = 360.
 


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!