SAP RS_GET_TYPE_FROM_DATA Function Module for Get the ABAP data type of the data
RS_GET_TYPE_FROM_DATA is a standard rs get type from data 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 the ABAP data type of the data 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 rs get type from data FM, simply by entering the name RS_GET_TYPE_FROM_DATA into the relevant SAP transaction such as SE37 or SE38.
Function Group: RSDS_SERVICES
Program Name: SAPLRSDS_SERVICES
Main Program: SAPLRSDS_SERVICES
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RS_GET_TYPE_FROM_DATA 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 'RS_GET_TYPE_FROM_DATA'"Get the ABAP data type of the data.
EXPORTING
I_DATA = "Data
* I_CHAR1000 = "Separator for Thousands
* I_DEZICHAR = "Character Used for Decimal Point
* I_LEVEL = 0 "Integer with +/- Sign (-2.147.483.648 .. 2.147.483.647)
CHANGING
E_DATATYPE = "Data Type
E_TYPENUM = "Integer with +/- Sign (-2.147.483.648 .. 2.147.483.647)
E_CONVEXIT = "Conversion Routine
E_LENG = "Length (No. of Characters)
E_CONVTYPE = "Data Input Format (Internal/External)
E_DECIMAL = "Number of Decimal Places
E_LOWERCASE = "Lowercase letters allowed/not allowed
E_UNIFIELDNM = "Name of Referenced Currency Field / Unit Field
IMPORTING Parameters details for RS_GET_TYPE_FROM_DATA
I_DATA - Data
Data type: STRINGOptional: No
Call by Reference: Yes
I_CHAR1000 - Separator for Thousands
Data type: RSTHOUSANDOptional: Yes
Call by Reference: No ( called with pass by value option)
I_DEZICHAR - Character Used for Decimal Point
Data type: RSDECIMALOptional: Yes
Call by Reference: No ( called with pass by value option)
I_LEVEL - Integer with +/- Sign (-2.147.483.648 .. 2.147.483.647)
Data type: IOptional: Yes
Call by Reference: No ( called with pass by value option)
CHANGING Parameters details for RS_GET_TYPE_FROM_DATA
E_DATATYPE - Data Type
Data type: RSDATATYPEOptional: No
Call by Reference: No ( called with pass by value option)
E_TYPENUM - Integer with +/- Sign (-2.147.483.648 .. 2.147.483.647)
Data type: IOptional: No
Call by Reference: No ( called with pass by value option)
E_CONVEXIT - Conversion Routine
Data type: CONVEXITOptional: No
Call by Reference: No ( called with pass by value option)
E_LENG - Length (No. of Characters)
Data type: DDLENGOptional: No
Call by Reference: No ( called with pass by value option)
E_CONVTYPE - Data Input Format (Internal/External)
Data type: RSDS_CONVTYPEOptional: No
Call by Reference: No ( called with pass by value option)
E_DECIMAL - Number of Decimal Places
Data type: DECIMALSOptional: No
Call by Reference: No ( called with pass by value option)
E_LOWERCASE - Lowercase letters allowed/not allowed
Data type: LOWERCASEOptional: No
Call by Reference: No ( called with pass by value option)
E_UNIFIELDNM - Name of Referenced Currency Field / Unit Field
Data type: RSDS_UNIFIELDNMOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for RS_GET_TYPE_FROM_DATA 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_data | TYPE STRING, " | |||
| lv_e_datatype | TYPE RSDATATYPE, " | |||
| lv_e_typenum | TYPE I, " | |||
| lv_i_char1000 | TYPE RSTHOUSAND, " | |||
| lv_e_convexit | TYPE CONVEXIT, " | |||
| lv_i_dezichar | TYPE RSDECIMAL, " | |||
| lv_e_leng | TYPE DDLENG, " | |||
| lv_i_level | TYPE I, " 0 | |||
| lv_e_convtype | TYPE RSDS_CONVTYPE, " | |||
| lv_e_decimal | TYPE DECIMALS, " | |||
| lv_e_lowercase | TYPE LOWERCASE, " | |||
| lv_e_unifieldnm | TYPE RSDS_UNIFIELDNM. " |
|   CALL FUNCTION 'RS_GET_TYPE_FROM_DATA' "Get the ABAP data type of the data |
| EXPORTING | ||
| I_DATA | = lv_i_data | |
| I_CHAR1000 | = lv_i_char1000 | |
| I_DEZICHAR | = lv_i_dezichar | |
| I_LEVEL | = lv_i_level | |
| CHANGING | ||
| E_DATATYPE | = lv_e_datatype | |
| E_TYPENUM | = lv_e_typenum | |
| E_CONVEXIT | = lv_e_convexit | |
| E_LENG | = lv_e_leng | |
| E_CONVTYPE | = lv_e_convtype | |
| E_DECIMAL | = lv_e_decimal | |
| E_LOWERCASE | = lv_e_lowercase | |
| E_UNIFIELDNM | = lv_e_unifieldnm | |
| . " RS_GET_TYPE_FROM_DATA | ||
ABAP code using 7.40 inline data declarations to call FM RS_GET_TYPE_FROM_DATA
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