SAP RSPOR_SETUP_CREATE_DESTINATION Function Module for Create RFC Destination
RSPOR_SETUP_CREATE_DESTINATION is a standard rspor setup create destination SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Create RFC Destination 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 rspor setup create destination FM, simply by entering the name RSPOR_SETUP_CREATE_DESTINATION into the relevant SAP transaction such as SE37 or SE38.
Function Group: RSPOR
Program Name: SAPLRSPOR
Main Program: SAPLRSPOR
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function RSPOR_SETUP_CREATE_DESTINATION 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 'RSPOR_SETUP_CREATE_DESTINATION'"Create RFC Destination.
EXPORTING
I_RFC_DEST_NAME = "Logical Destination (Specified When Function Is Called)
I_PROGRAM_ID = "Program Name (Complete Path)
I_RFC_DEST_DESCRIPTION = "Description of RFC Connection
* I_GATEWAY_HOST = "Gateway Host Name
* I_GATEWAY_SERVICE = "Gateway Service
* I_POPUP = 'X' "Boolean
* I_MODIFY = ' ' "Boolean
EXCEPTIONS
NO_AUTHORIZATION_SMGW = 1 NO_AUTHORIZATION_RFC = 2 RFC_DESTINATION_EXIST = 3 RFC_DESTINATION_NOT_EXIST = 4 RFC_DESTINATION_LOCKED = 5 RFC_DESTINATION_ERROR = 6
IMPORTING Parameters details for RSPOR_SETUP_CREATE_DESTINATION
I_RFC_DEST_NAME - Logical Destination (Specified When Function Is Called)
Data type: RFCDES-RFCDESTOptional: No
Call by Reference: No ( called with pass by value option)
I_PROGRAM_ID - Program Name (Complete Path)
Data type: RFCDISPLAY-RFCEXECOptional: No
Call by Reference: No ( called with pass by value option)
I_RFC_DEST_DESCRIPTION - Description of RFC Connection
Data type: RFCDOC-RFCDOC1Optional: No
Call by Reference: No ( called with pass by value option)
I_GATEWAY_HOST - Gateway Host Name
Data type: RFCDISPLAY-RFCGWHOSTOptional: Yes
Call by Reference: No ( called with pass by value option)
I_GATEWAY_SERVICE - Gateway Service
Data type: RFCDISPLAY-RFCGWSERVOptional: Yes
Call by Reference: No ( called with pass by value option)
I_POPUP - Boolean
Data type: RS_BOOLDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_MODIFY - Boolean
Data type: RS_BOOLDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_AUTHORIZATION_SMGW -
Data type:Optional: No
Call by Reference: Yes
NO_AUTHORIZATION_RFC -
Data type:Optional: No
Call by Reference: Yes
RFC_DESTINATION_EXIST -
Data type:Optional: No
Call by Reference: Yes
RFC_DESTINATION_NOT_EXIST -
Data type:Optional: No
Call by Reference: Yes
RFC_DESTINATION_LOCKED -
Data type:Optional: No
Call by Reference: Yes
RFC_DESTINATION_ERROR -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for RSPOR_SETUP_CREATE_DESTINATION 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_rfc_dest_name | TYPE RFCDES-RFCDEST, " | |||
| lv_no_authorization_smgw | TYPE RFCDES, " | |||
| lv_i_program_id | TYPE RFCDISPLAY-RFCEXEC, " | |||
| lv_no_authorization_rfc | TYPE RFCDISPLAY, " | |||
| lv_rfc_destination_exist | TYPE RFCDISPLAY, " | |||
| lv_i_rfc_dest_description | TYPE RFCDOC-RFCDOC1, " | |||
| lv_i_gateway_host | TYPE RFCDISPLAY-RFCGWHOST, " | |||
| lv_rfc_destination_not_exist | TYPE RFCDISPLAY, " | |||
| lv_i_gateway_service | TYPE RFCDISPLAY-RFCGWSERV, " | |||
| lv_rfc_destination_locked | TYPE RFCDISPLAY, " | |||
| lv_i_popup | TYPE RS_BOOL, " 'X' | |||
| lv_rfc_destination_error | TYPE RS_BOOL, " | |||
| lv_i_modify | TYPE RS_BOOL. " SPACE |
|   CALL FUNCTION 'RSPOR_SETUP_CREATE_DESTINATION' "Create RFC Destination |
| EXPORTING | ||
| I_RFC_DEST_NAME | = lv_i_rfc_dest_name | |
| I_PROGRAM_ID | = lv_i_program_id | |
| I_RFC_DEST_DESCRIPTION | = lv_i_rfc_dest_description | |
| I_GATEWAY_HOST | = lv_i_gateway_host | |
| I_GATEWAY_SERVICE | = lv_i_gateway_service | |
| I_POPUP | = lv_i_popup | |
| I_MODIFY | = lv_i_modify | |
| EXCEPTIONS | ||
| NO_AUTHORIZATION_SMGW = 1 | ||
| NO_AUTHORIZATION_RFC = 2 | ||
| RFC_DESTINATION_EXIST = 3 | ||
| RFC_DESTINATION_NOT_EXIST = 4 | ||
| RFC_DESTINATION_LOCKED = 5 | ||
| RFC_DESTINATION_ERROR = 6 | ||
| . " RSPOR_SETUP_CREATE_DESTINATION | ||
ABAP code using 7.40 inline data declarations to call FM RSPOR_SETUP_CREATE_DESTINATION
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 RFCDEST FROM RFCDES INTO @DATA(ld_i_rfc_dest_name). | ||||
| "SELECT single RFCEXEC FROM RFCDISPLAY INTO @DATA(ld_i_program_id). | ||||
| "SELECT single RFCDOC1 FROM RFCDOC INTO @DATA(ld_i_rfc_dest_description). | ||||
| "SELECT single RFCGWHOST FROM RFCDISPLAY INTO @DATA(ld_i_gateway_host). | ||||
| "SELECT single RFCGWSERV FROM RFCDISPLAY INTO @DATA(ld_i_gateway_service). | ||||
| DATA(ld_i_popup) | = 'X'. | |||
| DATA(ld_i_modify) | = ' '. | |||
Search for further information about these or an SAP related objects