SAP GWY_TRACE_CLIENT Function Module for
GWY_TRACE_CLIENT is a standard gwy trace client 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 gwy trace client FM, simply by entering the name GWY_TRACE_CLIENT into the relevant SAP transaction such as SE37 or SE38.
Function Group: SGWY
Program Name: SAPLSGWY
Main Program: SAPLSGWY
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function GWY_TRACE_CLIENT 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 'GWY_TRACE_CLIENT'".
EXPORTING
IDX = "Number of connection
TRACE = "
* GWHOST = "
* GWSERV = "
* DISCONNECT = "Terminate connection
EXCEPTIONS
GWY_UNKNOWN_OPCODE = 1 GWY_MONITOR_DISABLED = 10 GWY_NOT_AUTHORIZED = 11 GWY_COMMUNICATION_FAILURE = 2 GWY_GET_IDX_FAILED = 3 GWY_GET_OPCODE_FAILED = 4 GWY_GET_GWHOST_FAILED = 5 GWY_GET_GWSERV_FAILED = 6 GWY_INDEX_OUTOFRANGE = 7 GWY_INDEX_EINVAL = 8 GWY_UNKNOWN_CLIENT_TYPE = 9
IMPORTING Parameters details for GWY_TRACE_CLIENT
IDX - Number of connection
Data type: GWY_STRUCT-SYSIDXOptional: No
Call by Reference: No ( called with pass by value option)
TRACE -
Data type: GWY_STRUCT-FLAGOptional: No
Call by Reference: No ( called with pass by value option)
GWHOST -
Data type: GWY_STRUCT-GWHOSTOptional: Yes
Call by Reference: No ( called with pass by value option)
GWSERV -
Data type: GWY_STRUCT-GWSERVOptional: Yes
Call by Reference: No ( called with pass by value option)
DISCONNECT - Terminate connection
Data type: GWY_STRUCT-FLAGOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
GWY_UNKNOWN_OPCODE - Unknown OP code
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
GWY_MONITOR_DISABLED -
Data type:Optional: No
Call by Reference: Yes
GWY_NOT_AUTHORIZED - No Authorization
Data type:Optional: No
Call by Reference: Yes
GWY_COMMUNICATION_FAILURE - Communication Error
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
GWY_GET_IDX_FAILED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
GWY_GET_OPCODE_FAILED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
GWY_GET_GWHOST_FAILED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
GWY_GET_GWSERV_FAILED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
GWY_INDEX_OUTOFRANGE -
Data type:Optional: No
Call by Reference: Yes
GWY_INDEX_EINVAL -
Data type:Optional: No
Call by Reference: Yes
GWY_UNKNOWN_CLIENT_TYPE -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for GWY_TRACE_CLIENT 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_idx | TYPE GWY_STRUCT-SYSIDX, " | |||
| lv_gwy_unknown_opcode | TYPE GWY_STRUCT, " | |||
| lv_gwy_monitor_disabled | TYPE GWY_STRUCT, " | |||
| lv_gwy_not_authorized | TYPE GWY_STRUCT, " | |||
| lv_trace | TYPE GWY_STRUCT-FLAG, " | |||
| lv_gwy_communication_failure | TYPE GWY_STRUCT, " | |||
| lv_gwhost | TYPE GWY_STRUCT-GWHOST, " | |||
| lv_gwy_get_idx_failed | TYPE GWY_STRUCT, " | |||
| lv_gwserv | TYPE GWY_STRUCT-GWSERV, " | |||
| lv_gwy_get_opcode_failed | TYPE GWY_STRUCT, " | |||
| lv_disconnect | TYPE GWY_STRUCT-FLAG, " | |||
| lv_gwy_get_gwhost_failed | TYPE GWY_STRUCT, " | |||
| lv_gwy_get_gwserv_failed | TYPE GWY_STRUCT, " | |||
| lv_gwy_index_outofrange | TYPE GWY_STRUCT, " | |||
| lv_gwy_index_einval | TYPE GWY_STRUCT, " | |||
| lv_gwy_unknown_client_type | TYPE GWY_STRUCT. " |
|   CALL FUNCTION 'GWY_TRACE_CLIENT' " |
| EXPORTING | ||
| IDX | = lv_idx | |
| TRACE | = lv_trace | |
| GWHOST | = lv_gwhost | |
| GWSERV | = lv_gwserv | |
| DISCONNECT | = lv_disconnect | |
| EXCEPTIONS | ||
| GWY_UNKNOWN_OPCODE = 1 | ||
| GWY_MONITOR_DISABLED = 10 | ||
| GWY_NOT_AUTHORIZED = 11 | ||
| GWY_COMMUNICATION_FAILURE = 2 | ||
| GWY_GET_IDX_FAILED = 3 | ||
| GWY_GET_OPCODE_FAILED = 4 | ||
| GWY_GET_GWHOST_FAILED = 5 | ||
| GWY_GET_GWSERV_FAILED = 6 | ||
| GWY_INDEX_OUTOFRANGE = 7 | ||
| GWY_INDEX_EINVAL = 8 | ||
| GWY_UNKNOWN_CLIENT_TYPE = 9 | ||
| . " GWY_TRACE_CLIENT | ||
ABAP code using 7.40 inline data declarations to call FM GWY_TRACE_CLIENT
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 SYSIDX FROM GWY_STRUCT INTO @DATA(ld_idx). | ||||
| "SELECT single FLAG FROM GWY_STRUCT INTO @DATA(ld_trace). | ||||
| "SELECT single GWHOST FROM GWY_STRUCT INTO @DATA(ld_gwhost). | ||||
| "SELECT single GWSERV FROM GWY_STRUCT INTO @DATA(ld_gwserv). | ||||
| "SELECT single FLAG FROM GWY_STRUCT INTO @DATA(ld_disconnect). | ||||
Search for further information about these or an SAP related objects