RSDU_EXEC_SQL is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.
See here to view full function module documentation and code listing, simply by entering the name RSDU_EXEC_SQL into the relevant SAP transaction such as SE37 or SE80.
Associated Function Group:
RSDU_SQL
Released Date:
Not Released
Processing type: Normal fucntion module
CALL FUNCTION 'RSDU_EXEC_SQL' "Execute Native SQL Statement (No CURSORs, Host Variables etc.)
* EXPORTING
* i_t_stmt = " rsdu_t_abapsource SQL Statement in an Internal Table
* i_stmt = " c SQL Statement in a String
* i_lower_trans = RS_C_FALSE " rs_bool SQL Keywords in Lowercase Yes/No
* i_error_download = RS_C_TRUE " rs_bool Download of a Erroneous SQL Statement Yes/No
* i_connection = 'DEFAULT' " dbcon_name Logical Name for a Database Connection
IMPORTING
e_sqlerr = " i DB-Specific SQL-Error Code (OK = 0)
e_sqlerrtxt = " rsdu_string72 SQL Error Text
e_stmtsize = " i Size of the SQL Statement in Bytes
e_num_rows = " i Number of Rows Affected
EXCEPTIONS
SQL_ERROR = 1 " SQL Error (Specific Error in E_SQLERR)
STATEMENT_TOO_COMPLEX = 2 " SQL Statement Too Complex (Long)
NO_STATEMENT = 3 " No Internal Table or String
INHERITED_ERROR = 4 " Internal Error
DUPREC = 5 " Duplicate Record
OBJ_EXISTS = 6 " Object Already Exists
OBJ_NOT_FOUND = 7 " Object Not Found
. " RSDU_EXEC_SQL
The ABAP code below is a full code listing to execute function module RSDU_EXEC_SQL including all data declarations. The code uses 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 original method of declaring data variables up front. 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).
| ld_e_sqlerr | TYPE I , |
| ld_e_sqlerrtxt | TYPE RSDU_STRING72 , |
| ld_e_stmtsize | TYPE I , |
| ld_e_num_rows | TYPE I . |
The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.
DATA:
| ld_e_sqlerr | TYPE I , |
| ld_i_t_stmt | TYPE RSDU_T_ABAPSOURCE , |
| ld_e_sqlerrtxt | TYPE RSDU_STRING72 , |
| ld_i_stmt | TYPE C , |
| ld_e_stmtsize | TYPE I , |
| ld_i_lower_trans | TYPE RS_BOOL , |
| ld_e_num_rows | TYPE I , |
| ld_i_error_download | TYPE RS_BOOL , |
| ld_i_connection | TYPE DBCON_NAME . |
Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name RSDU_EXEC_SQL or its description.
RSDU_EXEC_SQL - Execute Native SQL Statement (No CURSORs, Host Variables etc.) RSDU_EXECUTE_DSNUTIL_RFC_DB2 - Remote-enabled version of RSDU_EXECUTE_DSNUTIL_DB2 RSDU_EXECUTE_DSNUTIL_DB2 - Execute a DSNUTILS Stored Procedure RSDU_ESTIMATE_COUNT_SYB - Estimate number of rows in a table RSDU_ESTIMATE_COUNT_ORA - Specify (Approximate) Number of Entries in a Table RSDU_ESTIMATE_COUNT_MSS -