SAP RSDU_EXEC_SQL_ORA Function Module for Execute Native SQL Statement (No CURSORs, Host Variables etc.)
RSDU_EXEC_SQL_ORA is a standard rsdu exec sql ora SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Execute Native SQL Statement (No CURSORs, Host Variables etc.) 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 rsdu exec sql ora FM, simply by entering the name RSDU_EXEC_SQL_ORA into the relevant SAP transaction such as SE37 or SE38.
Function Group: RSDU_SQL_ORA
Program Name: SAPLRSDU_SQL_ORA
Main Program: SAPLRSDU_SQL_ORA
Appliation area: B
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RSDU_EXEC_SQL_ORA 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 'RSDU_EXEC_SQL_ORA'"Execute Native SQL Statement (No CURSORs, Host Variables etc.).
EXPORTING
* I_T_STMT = "SQL Statement in an Internal Table
* I_STMT = "SQL Statement in a String
* I_LOWER_TRANS = RS_C_FALSE "SQL Keywords in Lowercase Yes/No
* I_ERROR_DOWNLOAD = RS_C_TRUE "Download of a Erroneous SQL Statement Yes/No
* I_CONNECTION = 'DEFAULT' "Logical Name for a Database Connection
IMPORTING
E_SQLERR = "DB-Specific SQL-Error Code (OK = 0)
E_SQLERRTXT = "SQL Error Text
E_STMTSIZE = "Size of the SQL Statement in Bytes
E_NUM_ROWS = "Number of Rows Affected
CHANGING
* C_PROCESSED = RS_C_FALSE "Boolean
EXCEPTIONS
SQL_ERROR = 1 STATEMENT_TOO_COMPLEX = 2 NO_STATEMENT = 3 INHERITED_ERROR = 4 DUPREC = 5 OBJ_EXISTS = 6 OBJ_NOT_FOUND = 7
IMPORTING Parameters details for RSDU_EXEC_SQL_ORA
I_T_STMT - SQL Statement in an Internal Table
Data type: RSDU_T_ABAPSOURCEOptional: Yes
Call by Reference: Yes
I_STMT - SQL Statement in a String
Data type: COptional: Yes
Call by Reference: Yes
I_LOWER_TRANS - SQL Keywords in Lowercase Yes/No
Data type: RS_BOOLDefault: RS_C_FALSE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_ERROR_DOWNLOAD - Download of a Erroneous SQL Statement Yes/No
Data type: RS_BOOLDefault: RS_C_TRUE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_CONNECTION - Logical Name for a Database Connection
Data type: DBCON_NAMEDefault: 'DEFAULT'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for RSDU_EXEC_SQL_ORA
E_SQLERR - DB-Specific SQL-Error Code (OK = 0)
Data type: IOptional: No
Call by Reference: Yes
E_SQLERRTXT - SQL Error Text
Data type: RSDU_STRING72Optional: No
Call by Reference: Yes
E_STMTSIZE - Size of the SQL Statement in Bytes
Data type: IOptional: No
Call by Reference: Yes
E_NUM_ROWS - Number of Rows Affected
Data type: IOptional: No
Call by Reference: Yes
CHANGING Parameters details for RSDU_EXEC_SQL_ORA
C_PROCESSED - Boolean
Data type: RS_BOOLDefault: RS_C_FALSE
Optional: No
Call by Reference: Yes
EXCEPTIONS details
SQL_ERROR - SQL Error (Specific Error in E_SQLERR)
Data type:Optional: No
Call by Reference: Yes
STATEMENT_TOO_COMPLEX - SQL Statement Too Complex (Long)
Data type:Optional: No
Call by Reference: Yes
NO_STATEMENT - No Internal Table or String
Data type:Optional: No
Call by Reference: Yes
INHERITED_ERROR - Internal Error
Data type:Optional: No
Call by Reference: Yes
DUPREC - Duplicate Record
Data type:Optional: No
Call by Reference: Yes
OBJ_EXISTS - Object Already Exists
Data type:Optional: No
Call by Reference: Yes
OBJ_NOT_FOUND - Object Not Found
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for RSDU_EXEC_SQL_ORA 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_sqlerr | TYPE I, " | |||
| lv_i_t_stmt | TYPE RSDU_T_ABAPSOURCE, " | |||
| lv_sql_error | TYPE RSDU_T_ABAPSOURCE, " | |||
| lv_c_processed | TYPE RS_BOOL, " RS_C_FALSE | |||
| lv_i_stmt | TYPE C, " | |||
| lv_e_sqlerrtxt | TYPE RSDU_STRING72, " | |||
| lv_statement_too_complex | TYPE RSDU_STRING72, " | |||
| lv_e_stmtsize | TYPE I, " | |||
| lv_no_statement | TYPE I, " | |||
| lv_i_lower_trans | TYPE RS_BOOL, " RS_C_FALSE | |||
| lv_e_num_rows | TYPE I, " | |||
| lv_inherited_error | TYPE I, " | |||
| lv_i_error_download | TYPE RS_BOOL, " RS_C_TRUE | |||
| lv_duprec | TYPE RS_BOOL, " | |||
| lv_i_connection | TYPE DBCON_NAME, " 'DEFAULT' | |||
| lv_obj_exists | TYPE DBCON_NAME, " | |||
| lv_obj_not_found | TYPE DBCON_NAME. " |
|   CALL FUNCTION 'RSDU_EXEC_SQL_ORA' "Execute Native SQL Statement (No CURSORs, Host Variables etc.) |
| EXPORTING | ||
| I_T_STMT | = lv_i_t_stmt | |
| I_STMT | = lv_i_stmt | |
| I_LOWER_TRANS | = lv_i_lower_trans | |
| I_ERROR_DOWNLOAD | = lv_i_error_download | |
| I_CONNECTION | = lv_i_connection | |
| IMPORTING | ||
| E_SQLERR | = lv_e_sqlerr | |
| E_SQLERRTXT | = lv_e_sqlerrtxt | |
| E_STMTSIZE | = lv_e_stmtsize | |
| E_NUM_ROWS | = lv_e_num_rows | |
| CHANGING | ||
| C_PROCESSED | = lv_c_processed | |
| EXCEPTIONS | ||
| SQL_ERROR = 1 | ||
| STATEMENT_TOO_COMPLEX = 2 | ||
| NO_STATEMENT = 3 | ||
| INHERITED_ERROR = 4 | ||
| DUPREC = 5 | ||
| OBJ_EXISTS = 6 | ||
| OBJ_NOT_FOUND = 7 | ||
| . " RSDU_EXEC_SQL_ORA | ||
ABAP code using 7.40 inline data declarations to call FM RSDU_EXEC_SQL_ORA
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_c_processed) | = RS_C_FALSE. | |||
| DATA(ld_i_lower_trans) | = RS_C_FALSE. | |||
| DATA(ld_i_error_download) | = RS_C_TRUE. | |||
| DATA(ld_i_connection) | = 'DEFAULT'. | |||
Search for further information about these or an SAP related objects