SAP RRBA_NUMBER_GET_BW Function Module for Cross-Client Number Assignment and Creation of Intervals if Necessary
RRBA_NUMBER_GET_BW is a standard rrba number get bw SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Cross-Client Number Assignment and Creation of Intervals if Necessary 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 rrba number get bw FM, simply by entering the name RRBA_NUMBER_GET_BW into the relevant SAP transaction such as SE37 or SE38.
Function Group: RRBA
Program Name: SAPLRRBA
Main Program: SAPLRRBA
Appliation area: B
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RRBA_NUMBER_GET_BW 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 'RRBA_NUMBER_GET_BW'"Cross-Client Number Assignment and Creation of Intervals if Necessary.
EXPORTING
I_NR_RANGE_NR = "
* I_CONNECTION = "Logical Name for a Database Connection
I_OBJECT = "
* I_QUANTITY = '1' "
* I_SUBOBJECT = ' ' "Value of Subobject of Number Range Object
* I_TOYEAR = '0000' "
* I_INTERVAL_CREATE = 'X' "Flag structure
* I_FROMNUMBER = "
* I_TONUMBER = "
* I_NATIVE_SQL = RS_C_FALSE "If Indicator = X, Get Number Using Native SQL
IMPORTING
E_NUMBER = "
E_QUANTITY = "
E_INTERVAL_CREATED = "Boolean
EXCEPTIONS
INTERVAL_NOT_FOUND = 1 INTERVAL_OVERFLOW = 2 GENERAL_ERROR = 3 OBJECT_NOT_FOUND = 4
IMPORTING Parameters details for RRBA_NUMBER_GET_BW
I_NR_RANGE_NR -
Data type: INRI-NRRANGENROptional: No
Call by Reference: No ( called with pass by value option)
I_CONNECTION - Logical Name for a Database Connection
Data type: DBCON_NAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
I_OBJECT -
Data type: INRI-OBJECTOptional: No
Call by Reference: No ( called with pass by value option)
I_QUANTITY -
Data type: INRI-QUANTITYDefault: '1'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_SUBOBJECT - Value of Subobject of Number Range Object
Data type: INRI-SUBOBJECTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_TOYEAR -
Data type: INRI-TOYEARDefault: '0000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_INTERVAL_CREATE - Flag structure
Data type: RS_BOOLDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_FROMNUMBER -
Data type: INRIV-FROMNUMBEROptional: Yes
Call by Reference: No ( called with pass by value option)
I_TONUMBER -
Data type: INRIV-TONUMBEROptional: Yes
Call by Reference: No ( called with pass by value option)
I_NATIVE_SQL - If Indicator = X, Get Number Using Native SQL
Data type: RS_BOOLDefault: RS_C_FALSE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for RRBA_NUMBER_GET_BW
E_NUMBER -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
E_QUANTITY -
Data type: INRI-QUANTITYOptional: No
Call by Reference: No ( called with pass by value option)
E_INTERVAL_CREATED - Boolean
Data type: RS_BOOLOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
INTERVAL_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INTERVAL_OVERFLOW -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
GENERAL_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OBJECT_NOT_FOUND -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for RRBA_NUMBER_GET_BW 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_e_number | TYPE STRING, " | |||
| lv_i_nr_range_nr | TYPE INRI-NRRANGENR, " | |||
| lv_interval_not_found | TYPE INRI, " | |||
| lv_i_connection | TYPE DBCON_NAME, " | |||
| lv_i_object | TYPE INRI-OBJECT, " | |||
| lv_e_quantity | TYPE INRI-QUANTITY, " | |||
| lv_interval_overflow | TYPE INRI, " | |||
| lv_i_quantity | TYPE INRI-QUANTITY, " '1' | |||
| lv_general_error | TYPE INRI, " | |||
| lv_e_interval_created | TYPE RS_BOOL, " | |||
| lv_i_subobject | TYPE INRI-SUBOBJECT, " SPACE | |||
| lv_object_not_found | TYPE INRI, " | |||
| lv_i_toyear | TYPE INRI-TOYEAR, " '0000' | |||
| lv_i_interval_create | TYPE RS_BOOL, " 'X' | |||
| lv_i_fromnumber | TYPE INRIV-FROMNUMBER, " | |||
| lv_i_tonumber | TYPE INRIV-TONUMBER, " | |||
| lv_i_native_sql | TYPE RS_BOOL. " RS_C_FALSE |
|   CALL FUNCTION 'RRBA_NUMBER_GET_BW' "Cross-Client Number Assignment and Creation of Intervals if Necessary |
| EXPORTING | ||
| I_NR_RANGE_NR | = lv_i_nr_range_nr | |
| I_CONNECTION | = lv_i_connection | |
| I_OBJECT | = lv_i_object | |
| I_QUANTITY | = lv_i_quantity | |
| I_SUBOBJECT | = lv_i_subobject | |
| I_TOYEAR | = lv_i_toyear | |
| I_INTERVAL_CREATE | = lv_i_interval_create | |
| I_FROMNUMBER | = lv_i_fromnumber | |
| I_TONUMBER | = lv_i_tonumber | |
| I_NATIVE_SQL | = lv_i_native_sql | |
| IMPORTING | ||
| E_NUMBER | = lv_e_number | |
| E_QUANTITY | = lv_e_quantity | |
| E_INTERVAL_CREATED | = lv_e_interval_created | |
| EXCEPTIONS | ||
| INTERVAL_NOT_FOUND = 1 | ||
| INTERVAL_OVERFLOW = 2 | ||
| GENERAL_ERROR = 3 | ||
| OBJECT_NOT_FOUND = 4 | ||
| . " RRBA_NUMBER_GET_BW | ||
ABAP code using 7.40 inline data declarations to call FM RRBA_NUMBER_GET_BW
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 NRRANGENR FROM INRI INTO @DATA(ld_i_nr_range_nr). | ||||
| "SELECT single OBJECT FROM INRI INTO @DATA(ld_i_object). | ||||
| "SELECT single QUANTITY FROM INRI INTO @DATA(ld_e_quantity). | ||||
| "SELECT single QUANTITY FROM INRI INTO @DATA(ld_i_quantity). | ||||
| DATA(ld_i_quantity) | = '1'. | |||
| "SELECT single SUBOBJECT FROM INRI INTO @DATA(ld_i_subobject). | ||||
| DATA(ld_i_subobject) | = ' '. | |||
| "SELECT single TOYEAR FROM INRI INTO @DATA(ld_i_toyear). | ||||
| DATA(ld_i_toyear) | = '0000'. | |||
| DATA(ld_i_interval_create) | = 'X'. | |||
| "SELECT single FROMNUMBER FROM INRIV INTO @DATA(ld_i_fromnumber). | ||||
| "SELECT single TONUMBER FROM INRIV INTO @DATA(ld_i_tonumber). | ||||
| DATA(ld_i_native_sql) | = RS_C_FALSE. | |||
Search for further information about these or an SAP related objects