SAP RRBA_CONVERT_PACKED_NUMBER Function Module for Converts a String into the Various Number Types
RRBA_CONVERT_PACKED_NUMBER is a standard rrba convert packed number SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Converts a String into the Various Number Types 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 convert packed number FM, simply by entering the name RRBA_CONVERT_PACKED_NUMBER into the relevant SAP transaction such as SE37 or SE38.
Function Group: RRBA
Program Name: SAPLRRBA
Main Program: SAPLRRBA
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RRBA_CONVERT_PACKED_NUMBER 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_CONVERT_PACKED_NUMBER'"Converts a String into the Various Number Types.
EXPORTING
I_CHAR = "Number in any Format
* I_DECIMALS = RRSI_C_SID-NOT_EXIST "Number of Decimal Places Displayed
* I_DECIMAL_MARK = '.' "Decimal Points (,.) Displayed
* I_DECIMAL_MARK_IN = "Decimal Character of i_char if <> i_decimal_mark
* I_SIGN_PRSNT = ' ' "Display of Plus/Minus Sign (1 -.., 2 ..- , 3 (..)
IMPORTING
E_VALUE_CHAR = "ABAP-Internal Value as String
E_VALUE_WRITE = "Number Displayed as Intended
E_VALUE_FLOAT = "Number of Type f
E_VALUE_PACKED = "Number of Type p_decimals i_decimals
E_VALUE_DECFLOAT = "DecFloat
E_TOO_MANY_DECIMALS = "'X': Decimal Places Were Truncated
EXCEPTIONS
TOO_BIG = 1 INPUT_NOT_LEGAL = 2 ILLEGAL_SIGN_PRSNT = 3 ILLEGAL_DECIMAL_MARK = 4
IMPORTING Parameters details for RRBA_CONVERT_PACKED_NUMBER
I_CHAR - Number in any Format
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
I_DECIMALS - Number of Decimal Places Displayed
Data type: IDefault: RRSI_C_SID-NOT_EXIST
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_DECIMAL_MARK - Decimal Points (,.) Displayed
Data type: CDefault: '.'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_DECIMAL_MARK_IN - Decimal Character of i_char if <> i_decimal_mark
Data type: COptional: Yes
Call by Reference: No ( called with pass by value option)
I_SIGN_PRSNT - Display of Plus/Minus Sign (1 -.., 2 ..- , 3 (..)
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for RRBA_CONVERT_PACKED_NUMBER
E_VALUE_CHAR - ABAP-Internal Value as String
Data type: CLIKEOptional: No
Call by Reference: No ( called with pass by value option)
E_VALUE_WRITE - Number Displayed as Intended
Data type: CLIKEOptional: No
Call by Reference: No ( called with pass by value option)
E_VALUE_FLOAT - Number of Type f
Data type: FOptional: No
Call by Reference: No ( called with pass by value option)
E_VALUE_PACKED - Number of Type p_decimals i_decimals
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
E_VALUE_DECFLOAT - DecFloat
Data type: RSROA_DFOptional: No
Call by Reference: No ( called with pass by value option)
E_TOO_MANY_DECIMALS - 'X': Decimal Places Were Truncated
Data type: CLIKEOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
TOO_BIG - Number Too Large
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INPUT_NOT_LEGAL - Value Entered Is Not a Number
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ILLEGAL_SIGN_PRSNT - Plus/Minus Sign Display Not Supported
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ILLEGAL_DECIMAL_MARK - Decimal Character Not Supported
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for RRBA_CONVERT_PACKED_NUMBER 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_char | TYPE STRING, " | |||
| lv_too_big | TYPE STRING, " | |||
| lv_e_value_char | TYPE CLIKE, " | |||
| lv_i_decimals | TYPE I, " RRSI_C_SID-NOT_EXIST | |||
| lv_e_value_write | TYPE CLIKE, " | |||
| lv_input_not_legal | TYPE CLIKE, " | |||
| lv_e_value_float | TYPE F, " | |||
| lv_i_decimal_mark | TYPE C, " ',' | |||
| lv_illegal_sign_prsnt | TYPE C, " | |||
| lv_e_value_packed | TYPE C, " | |||
| lv_i_decimal_mark_in | TYPE C, " | |||
| lv_illegal_decimal_mark | TYPE C, " | |||
| lv_i_sign_prsnt | TYPE C, " SPACE | |||
| lv_e_value_decfloat | TYPE RSROA_DF, " | |||
| lv_e_too_many_decimals | TYPE CLIKE. " |
|   CALL FUNCTION 'RRBA_CONVERT_PACKED_NUMBER' "Converts a String into the Various Number Types |
| EXPORTING | ||
| I_CHAR | = lv_i_char | |
| I_DECIMALS | = lv_i_decimals | |
| I_DECIMAL_MARK | = lv_i_decimal_mark | |
| I_DECIMAL_MARK_IN | = lv_i_decimal_mark_in | |
| I_SIGN_PRSNT | = lv_i_sign_prsnt | |
| IMPORTING | ||
| E_VALUE_CHAR | = lv_e_value_char | |
| E_VALUE_WRITE | = lv_e_value_write | |
| E_VALUE_FLOAT | = lv_e_value_float | |
| E_VALUE_PACKED | = lv_e_value_packed | |
| E_VALUE_DECFLOAT | = lv_e_value_decfloat | |
| E_TOO_MANY_DECIMALS | = lv_e_too_many_decimals | |
| EXCEPTIONS | ||
| TOO_BIG = 1 | ||
| INPUT_NOT_LEGAL = 2 | ||
| ILLEGAL_SIGN_PRSNT = 3 | ||
| ILLEGAL_DECIMAL_MARK = 4 | ||
| . " RRBA_CONVERT_PACKED_NUMBER | ||
ABAP code using 7.40 inline data declarations to call FM RRBA_CONVERT_PACKED_NUMBER
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.| DATA(ld_i_decimals) | = RRSI_C_SID-NOT_EXIST. | |||
| DATA(ld_i_decimal_mark) | = '.'. | |||
| DATA(ld_i_sign_prsnt) | = ' '. | |||
Search for further information about these or an SAP related objects