SAP RFC_PREPARE_DESTINATION Function Module for
RFC_PREPARE_DESTINATION is a standard rfc prepare destination SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 rfc prepare destination FM, simply by entering the name RFC_PREPARE_DESTINATION into the relevant SAP transaction such as SE37 or SE38.
Function Group: CRFC
Program Name: SAPLCRFC
Main Program: SAPLCRFC
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RFC_PREPARE_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 'RFC_PREPARE_DESTINATION'".
EXPORTING
DESTINATION = "Destination for RFC use
* ACTION = 'C' "Processing mode ('C', 'D', 'L')
* AUTHORITY_CHECK = 'X' "SM59 AUTHORITY_CHECK active ?
* DESTCOPY = ' ' "Copy to new destination
* DESTLOCK = ' ' "Display destination as not modifiable (= X)
* DEQUEUE_SYNCHRON = ' ' "
* WRITE_SYSLOG = ABAP_TRUE "
EXCEPTIONS
AUTHORITY_NOT_AVAILABLE = 1 DESTINATION_ALREADY_EXIST = 2 DESTINATION_NOT_EXIST = 3 DESTINATION_ENQUEUE_REJECT = 4 DESTINATION_IS_LOCKED = 5 INFORMATION_FAILURE = 6 INTERNAL_FAILURE = 7
IMPORTING Parameters details for RFC_PREPARE_DESTINATION
DESTINATION - Destination for RFC use
Data type: RFCDISPLAY-RFCDESTOptional: No
Call by Reference: No ( called with pass by value option)
ACTION - Processing mode ('C', 'D', 'L')
Data type: RFCDISPLAY-RFCTRACEDefault: 'C'
Optional: Yes
Call by Reference: No ( called with pass by value option)
AUTHORITY_CHECK - SM59 AUTHORITY_CHECK active ?
Data type: RFCDISPLAY-RFCTRACEDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
DESTCOPY - Copy to new destination
Data type: RFCDISPLAY-RFCDESTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
DESTLOCK - Display destination as not modifiable (= X)
Data type: RFCDISPLAY-RFCLOCKDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
DEQUEUE_SYNCHRON -
Data type: RFCDISPLAY-RFCNOWAITDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
WRITE_SYSLOG -
Data type: RFCDEST_WRITE_SYSLOGDefault: ABAP_TRUE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
AUTHORITY_NOT_AVAILABLE - No authorization exists
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DESTINATION_ALREADY_EXIST - Destination already exists
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DESTINATION_NOT_EXIST - Destination does not exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DESTINATION_ENQUEUE_REJECT - Destination is locked by another user
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DESTINATION_IS_LOCKED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INFORMATION_FAILURE - Parameter (information) not correctly maintained
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INTERNAL_FAILURE - Internal error
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for RFC_PREPARE_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_destination | TYPE RFCDISPLAY-RFCDEST, " | |||
| lv_authority_not_available | TYPE RFCDISPLAY, " | |||
| lv_action | TYPE RFCDISPLAY-RFCTRACE, " 'C' | |||
| lv_destination_already_exist | TYPE RFCDISPLAY, " | |||
| lv_authority_check | TYPE RFCDISPLAY-RFCTRACE, " 'X' | |||
| lv_destination_not_exist | TYPE RFCDISPLAY, " | |||
| lv_destcopy | TYPE RFCDISPLAY-RFCDEST, " SPACE | |||
| lv_destination_enqueue_reject | TYPE RFCDISPLAY, " | |||
| lv_destlock | TYPE RFCDISPLAY-RFCLOCK, " SPACE | |||
| lv_destination_is_locked | TYPE RFCDISPLAY, " | |||
| lv_dequeue_synchron | TYPE RFCDISPLAY-RFCNOWAIT, " SPACE | |||
| lv_information_failure | TYPE RFCDISPLAY, " | |||
| lv_write_syslog | TYPE RFCDEST_WRITE_SYSLOG, " ABAP_TRUE | |||
| lv_internal_failure | TYPE RFCDEST_WRITE_SYSLOG. " |
|   CALL FUNCTION 'RFC_PREPARE_DESTINATION' " |
| EXPORTING | ||
| DESTINATION | = lv_destination | |
| ACTION | = lv_action | |
| AUTHORITY_CHECK | = lv_authority_check | |
| DESTCOPY | = lv_destcopy | |
| DESTLOCK | = lv_destlock | |
| DEQUEUE_SYNCHRON | = lv_dequeue_synchron | |
| WRITE_SYSLOG | = lv_write_syslog | |
| EXCEPTIONS | ||
| AUTHORITY_NOT_AVAILABLE = 1 | ||
| DESTINATION_ALREADY_EXIST = 2 | ||
| DESTINATION_NOT_EXIST = 3 | ||
| DESTINATION_ENQUEUE_REJECT = 4 | ||
| DESTINATION_IS_LOCKED = 5 | ||
| INFORMATION_FAILURE = 6 | ||
| INTERNAL_FAILURE = 7 | ||
| . " RFC_PREPARE_DESTINATION | ||
ABAP code using 7.40 inline data declarations to call FM RFC_PREPARE_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 RFCDISPLAY INTO @DATA(ld_destination). | ||||
| "SELECT single RFCTRACE FROM RFCDISPLAY INTO @DATA(ld_action). | ||||
| DATA(ld_action) | = 'C'. | |||
| "SELECT single RFCTRACE FROM RFCDISPLAY INTO @DATA(ld_authority_check). | ||||
| DATA(ld_authority_check) | = 'X'. | |||
| "SELECT single RFCDEST FROM RFCDISPLAY INTO @DATA(ld_destcopy). | ||||
| DATA(ld_destcopy) | = ' '. | |||
| "SELECT single RFCLOCK FROM RFCDISPLAY INTO @DATA(ld_destlock). | ||||
| DATA(ld_destlock) | = ' '. | |||
| "SELECT single RFCNOWAIT FROM RFCDISPLAY INTO @DATA(ld_dequeue_synchron). | ||||
| DATA(ld_dequeue_synchron) | = ' '. | |||
| DATA(ld_write_syslog) | = ABAP_TRUE. | |||
Search for further information about these or an SAP related objects