SAP RH_GET_NUMBER_RANGE Function Module for Check









RH_GET_NUMBER_RANGE is a standard rh get number range SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Check 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 rh get number range FM, simply by entering the name RH_GET_NUMBER_RANGE into the relevant SAP transaction such as SE37 or SE38.

Function Group: RHIN
Program Name: SAPLRHIN
Main Program:
Appliation area: H
Release date: 03-Sep-1999
Mode(Normal, Remote etc): Normal Function Module
Update:



Function RH_GET_NUMBER_RANGE 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 'RH_GET_NUMBER_RANGE'"Check
EXPORTING
NO_RANGE_NUM = "Number/Category of the Number Range
OBJECT_TYPE = "Object Type
PLAN_VERSION = "Plan Version

IMPORTING
FROM_NO = "From-number of the Number Range
LAST_NO = "Number Range Counter (Only for Internal Number Range)
RETURNCODE = "Return Code
TO_NO = "To Number of the Number Range

EXCEPTIONS
INTERVAL_NOT_FOUND = 1 OBJECT_TYPE_NOT_FOUND = 2 PLAN_VERSION_NOT_FOUND = 3 RP_PLAN_RANGES_NOT_DEFINED = 4
.




Customer Function user exits

Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.
EXIT_SAPLRHIN_001 Customer exit: Check number ranges for integration

IMPORTING Parameters details for RH_GET_NUMBER_RANGE

NO_RANGE_NUM - Number/Category of the Number Range

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

OBJECT_TYPE - Object Type

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

PLAN_VERSION - Plan Version

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

EXPORTING Parameters details for RH_GET_NUMBER_RANGE

FROM_NO - From-number of the Number Range

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

LAST_NO - Number Range Counter (Only for Internal Number Range)

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

RETURNCODE - Return Code

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

TO_NO - To Number of the Number Range

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

EXCEPTIONS details

INTERVAL_NOT_FOUND - Interval not Found

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

OBJECT_TYPE_NOT_FOUND - Object Type not in Table T778O

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

PLAN_VERSION_NOT_FOUND - Plan Version not in Table T778P

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

RP_PLAN_RANGES_NOT_DEFINED - RP Plan not Defined in TNRO.

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

Copy and paste ABAP code example for RH_GET_NUMBER_RANGE 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_from_no  TYPE NRIV-FROMNUMBER, "   
lv_no_range_num  TYPE NRIV-NRRANGENR, "   
lv_interval_not_found  TYPE NRIV, "   
lv_last_no  TYPE NRIV-NRLEVEL, "   
lv_object_type  TYPE PLOG-OTYPE, "   
lv_object_type_not_found  TYPE PLOG, "   
lv_returncode  TYPE SY-SUBRC, "   
lv_plan_version  TYPE PLOG-PLVAR, "   
lv_plan_version_not_found  TYPE PLOG, "   
lv_to_no  TYPE NRIV-TONUMBER, "   
lv_rp_plan_ranges_not_defined  TYPE NRIV. "   

  CALL FUNCTION 'RH_GET_NUMBER_RANGE'  "Check
    EXPORTING
         NO_RANGE_NUM = lv_no_range_num
         OBJECT_TYPE = lv_object_type
         PLAN_VERSION = lv_plan_version
    IMPORTING
         FROM_NO = lv_from_no
         LAST_NO = lv_last_no
         RETURNCODE = lv_returncode
         TO_NO = lv_to_no
    EXCEPTIONS
        INTERVAL_NOT_FOUND = 1
        OBJECT_TYPE_NOT_FOUND = 2
        PLAN_VERSION_NOT_FOUND = 3
        RP_PLAN_RANGES_NOT_DEFINED = 4
. " RH_GET_NUMBER_RANGE




ABAP code using 7.40 inline data declarations to call FM RH_GET_NUMBER_RANGE

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 FROMNUMBER FROM NRIV INTO @DATA(ld_from_no).
 
"SELECT single NRRANGENR FROM NRIV INTO @DATA(ld_no_range_num).
 
 
"SELECT single NRLEVEL FROM NRIV INTO @DATA(ld_last_no).
 
"SELECT single OTYPE FROM PLOG INTO @DATA(ld_object_type).
 
 
"SELECT single SUBRC FROM SY INTO @DATA(ld_returncode).
 
"SELECT single PLVAR FROM PLOG INTO @DATA(ld_plan_version).
 
 
"SELECT single TONUMBER FROM NRIV INTO @DATA(ld_to_no).
 
 


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!