SAP BGRFC_PREPARE_TRACING Function Module for
BGRFC_PREPARE_TRACING is a standard bgrfc prepare tracing 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 bgrfc prepare tracing FM, simply by entering the name BGRFC_PREPARE_TRACING into the relevant SAP transaction such as SE37 or SE38.
Function Group: BGRFC_EXTERN
Program Name: SAPLBGRFC_EXTERN
Main Program: SAPLBGRFC_EXTERN
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function BGRFC_PREPARE_TRACING 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 'BGRFC_PREPARE_TRACING'".
EXPORTING
* OPTIONS = "
* TRACE_USERNAME = "
* TRACE_TIME = "
* TRACE_DATE = "
IMPORTING
RFC_SERVER_NAME = "
DP_SERVER_NAME = "
GW_ACCEPT_REMOTE_TRACE_LEVEL = "
WP_ACCEPT_REMOTE_TRACE_LEVEL = "
RFC_TRACE_AUTHORITY = "
USER_TRACE_AUTHORITY = "
GW_TRACE_AUTHORITY = "
GW_PPARAMETER_ACTIVATION = "
WP_PPARAMETER_ACTIVATION = "
TABLES
* USERTRACE = "
* RFCTRACE = "
* GWTRACE = "
EXCEPTIONS
BGRFC_INVALID_PARAMETER = 1 BGRFC_NO_NETWORK_AUTHORITY = 2
IMPORTING Parameters details for BGRFC_PREPARE_TRACING
OPTIONS -
Data type: BGRFC_RFCTRACE_OPTIONSOptional: Yes
Call by Reference: No ( called with pass by value option)
TRACE_USERNAME -
Data type: SYUNAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
TRACE_TIME -
Data type: UTTIMEOptional: Yes
Call by Reference: No ( called with pass by value option)
TRACE_DATE -
Data type: UTDATEOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BGRFC_PREPARE_TRACING
RFC_SERVER_NAME -
Data type: RFCDESTOptional: No
Call by Reference: No ( called with pass by value option)
DP_SERVER_NAME -
Data type: MSNAME2Optional: No
Call by Reference: No ( called with pass by value option)
GW_ACCEPT_REMOTE_TRACE_LEVEL -
Data type: IOptional: No
Call by Reference: No ( called with pass by value option)
WP_ACCEPT_REMOTE_TRACE_LEVEL -
Data type: IOptional: No
Call by Reference: No ( called with pass by value option)
RFC_TRACE_AUTHORITY -
Data type: SAP_BOOLOptional: No
Call by Reference: No ( called with pass by value option)
USER_TRACE_AUTHORITY -
Data type: SAP_BOOLOptional: No
Call by Reference: No ( called with pass by value option)
GW_TRACE_AUTHORITY -
Data type: SAP_BOOLOptional: No
Call by Reference: No ( called with pass by value option)
GW_PPARAMETER_ACTIVATION -
Data type: SAP_BOOLOptional: No
Call by Reference: No ( called with pass by value option)
WP_PPARAMETER_ACTIVATION -
Data type: SAP_BOOLOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for BGRFC_PREPARE_TRACING
USERTRACE -
Data type: USERTRACEOptional: Yes
Call by Reference: Yes
RFCTRACE -
Data type: BGRFC_RFCTRACE_TABOptional: Yes
Call by Reference: Yes
GWTRACE -
Data type: BGRFC_RFCTRACE_TABOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
BGRFC_INVALID_PARAMETER -
Data type:Optional: No
Call by Reference: Yes
BGRFC_NO_NETWORK_AUTHORITY -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for BGRFC_PREPARE_TRACING 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_options | TYPE BGRFC_RFCTRACE_OPTIONS, " | |||
| lt_usertrace | TYPE STANDARD TABLE OF USERTRACE, " | |||
| lv_rfc_server_name | TYPE RFCDEST, " | |||
| lv_bgrfc_invalid_parameter | TYPE RFCDEST, " | |||
| lt_rfctrace | TYPE STANDARD TABLE OF BGRFC_RFCTRACE_TAB, " | |||
| lv_dp_server_name | TYPE MSNAME2, " | |||
| lv_trace_username | TYPE SYUNAME, " | |||
| lv_bgrfc_no_network_authority | TYPE SYUNAME, " | |||
| lt_gwtrace | TYPE STANDARD TABLE OF BGRFC_RFCTRACE_TAB, " | |||
| lv_trace_time | TYPE UTTIME, " | |||
| lv_gw_accept_remote_trace_level | TYPE I, " | |||
| lv_trace_date | TYPE UTDATE, " | |||
| lv_wp_accept_remote_trace_level | TYPE I, " | |||
| lv_rfc_trace_authority | TYPE SAP_BOOL, " | |||
| lv_user_trace_authority | TYPE SAP_BOOL, " | |||
| lv_gw_trace_authority | TYPE SAP_BOOL, " | |||
| lv_gw_pparameter_activation | TYPE SAP_BOOL, " | |||
| lv_wp_pparameter_activation | TYPE SAP_BOOL. " |
|   CALL FUNCTION 'BGRFC_PREPARE_TRACING' " |
| EXPORTING | ||
| OPTIONS | = lv_options | |
| TRACE_USERNAME | = lv_trace_username | |
| TRACE_TIME | = lv_trace_time | |
| TRACE_DATE | = lv_trace_date | |
| IMPORTING | ||
| RFC_SERVER_NAME | = lv_rfc_server_name | |
| DP_SERVER_NAME | = lv_dp_server_name | |
| GW_ACCEPT_REMOTE_TRACE_LEVEL | = lv_gw_accept_remote_trace_level | |
| WP_ACCEPT_REMOTE_TRACE_LEVEL | = lv_wp_accept_remote_trace_level | |
| RFC_TRACE_AUTHORITY | = lv_rfc_trace_authority | |
| USER_TRACE_AUTHORITY | = lv_user_trace_authority | |
| GW_TRACE_AUTHORITY | = lv_gw_trace_authority | |
| GW_PPARAMETER_ACTIVATION | = lv_gw_pparameter_activation | |
| WP_PPARAMETER_ACTIVATION | = lv_wp_pparameter_activation | |
| TABLES | ||
| USERTRACE | = lt_usertrace | |
| RFCTRACE | = lt_rfctrace | |
| GWTRACE | = lt_gwtrace | |
| EXCEPTIONS | ||
| BGRFC_INVALID_PARAMETER = 1 | ||
| BGRFC_NO_NETWORK_AUTHORITY = 2 | ||
| . " BGRFC_PREPARE_TRACING | ||
ABAP code using 7.40 inline data declarations to call FM BGRFC_PREPARE_TRACING
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.Search for further information about these or an SAP related objects