SAP STU3_ADMIN_INSERT_SQL_REMOTE Function Module for insert in a table on a remote system from itab
STU3_ADMIN_INSERT_SQL_REMOTE is a standard stu3 admin insert sql remote SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for insert in a table on a remote system from itab 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 stu3 admin insert sql remote FM, simply by entering the name STU3_ADMIN_INSERT_SQL_REMOTE into the relevant SAP transaction such as SE37 or SE38.
Function Group: STU3_ADMIN
Program Name: SAPLSTU3_ADMIN
Main Program: SAPLSTU3_ADMIN
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function STU3_ADMIN_INSERT_SQL_REMOTE 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 'STU3_ADMIN_INSERT_SQL_REMOTE'"insert in a table on a remote system from itab.
EXPORTING
* CON_NAME = "Logical name for a database connection
* SCHEMA = "Schema
TABNAME = "name of the insert db-table
TABSTRUC = "DDIC Structure for insert table
INSERT_ITAB = "Reference to itab which contains rows for insert
* COMMIT = "General Flag
* DO_NOT_CLOSE_CON = "General Flag
* REPORT_ERROR_TO_SYSLOG = ABAP_TRUE "
IMPORTING
SQLERR_REF = "Exception Class for SQL Error
CHANGING
* CON_REF = "Database Connection
EXCEPTIONS
ADBC_SQL_ERROR = 1 INTERNAL_ERROR = 2
IMPORTING Parameters details for STU3_ADMIN_INSERT_SQL_REMOTE
CON_NAME - Logical name for a database connection
Data type: DBCON-CON_NAMEOptional: Yes
Call by Reference: Yes
SCHEMA - Schema
Data type: DB2CREATOROptional: Yes
Call by Reference: No ( called with pass by value option)
TABNAME - name of the insert db-table
Data type: TABNAMEOptional: No
Call by Reference: Yes
TABSTRUC - DDIC Structure for insert table
Data type: DD02L-TABNAMEOptional: No
Call by Reference: Yes
INSERT_ITAB - Reference to itab which contains rows for insert
Data type: DATAOptional: No
Call by Reference: Yes
COMMIT - General Flag
Data type: FLAGOptional: Yes
Call by Reference: Yes
DO_NOT_CLOSE_CON - General Flag
Data type: FLAGOptional: Yes
Call by Reference: Yes
REPORT_ERROR_TO_SYSLOG -
Data type: ABAP_BOOLDefault: ABAP_TRUE
Optional: Yes
Call by Reference: Yes
EXPORTING Parameters details for STU3_ADMIN_INSERT_SQL_REMOTE
SQLERR_REF - Exception Class for SQL Error
Data type: CX_SQL_EXCEPTIONOptional: No
Call by Reference: Yes
CHANGING Parameters details for STU3_ADMIN_INSERT_SQL_REMOTE
CON_REF - Database Connection
Data type: CL_SQL_CONNECTIONOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
ADBC_SQL_ERROR -
Data type:Optional: No
Call by Reference: Yes
INTERNAL_ERROR -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for STU3_ADMIN_INSERT_SQL_REMOTE 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_con_ref | TYPE CL_SQL_CONNECTION, " | |||
| lv_con_name | TYPE DBCON-CON_NAME, " | |||
| lv_sqlerr_ref | TYPE CX_SQL_EXCEPTION, " | |||
| lv_adbc_sql_error | TYPE CX_SQL_EXCEPTION, " | |||
| lv_schema | TYPE DB2CREATOR, " | |||
| lv_internal_error | TYPE DB2CREATOR, " | |||
| lv_tabname | TYPE TABNAME, " | |||
| lv_tabstruc | TYPE DD02L-TABNAME, " | |||
| lv_insert_itab | TYPE DATA, " | |||
| lv_commit | TYPE FLAG, " | |||
| lv_do_not_close_con | TYPE FLAG, " | |||
| lv_report_error_to_syslog | TYPE ABAP_BOOL. " ABAP_TRUE |
|   CALL FUNCTION 'STU3_ADMIN_INSERT_SQL_REMOTE' "insert in a table on a remote system from itab |
| EXPORTING | ||
| CON_NAME | = lv_con_name | |
| SCHEMA | = lv_schema | |
| TABNAME | = lv_tabname | |
| TABSTRUC | = lv_tabstruc | |
| INSERT_ITAB | = lv_insert_itab | |
| COMMIT | = lv_commit | |
| DO_NOT_CLOSE_CON | = lv_do_not_close_con | |
| REPORT_ERROR_TO_SYSLOG | = lv_report_error_to_syslog | |
| IMPORTING | ||
| SQLERR_REF | = lv_sqlerr_ref | |
| CHANGING | ||
| CON_REF | = lv_con_ref | |
| EXCEPTIONS | ||
| ADBC_SQL_ERROR = 1 | ||
| INTERNAL_ERROR = 2 | ||
| . " STU3_ADMIN_INSERT_SQL_REMOTE | ||
ABAP code using 7.40 inline data declarations to call FM STU3_ADMIN_INSERT_SQL_REMOTE
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 CON_NAME FROM DBCON INTO @DATA(ld_con_name). | ||||
| "SELECT single TABNAME FROM DD02L INTO @DATA(ld_tabstruc). | ||||
| DATA(ld_report_error_to_syslog) | = ABAP_TRUE. | |||
Search for further information about these or an SAP related objects