Ansicht
Dokumentation

READ_WS_LOG - Read WebSocket Log

READ_WS_LOG - Read WebSocket Log

PERFORM Short Reference   PERFORM Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

The RFC enabled function module “READ_WS_LOG” can be used to read WebSocket log files from the same system and same client (internal usage). This means that the requests for remote function module “READ_WS_LOG” will fail when the function module is called from another client or another system.

The function module “READ_WS_LOG” has the following optional importing parameters as selection criteria:

  • TIMESTAMP_FROM; It is the system timestamp begin in format YYYYMMDDhhmmss
  • Default value is 00:00:00 time of current day

  • TIMESTAMP_TO; It is the system timestamp end in format YYYYMMDDhhmmss
  • Default value is 23:59:59 time of current day

  • COLLECT_FROM_ALL_APPL_SERVERS; when this flag is set, the function module will collect the WebSocket log entries from all active application servers in an ABAP system in accordance to query input parameters. When the function module “READ_WS_LOG” has called with the value abap_false for flag COLLECT_FROM_ALL_APPL_SERVERS, only the WebSocket log files from current application server will be presented.
  • Default value is: abap_true

The function module “READ_WS_LOG” has the following optional importing parameters as filter criteria (using filter criteria, the application can limit the number of hits of the above selection criteria):

  • APPLICATION_ID_LIST; List of application IDs. An application ID can be either an APC application (see transaction SAPC) or the caller program to access an APC application. Caller program is necessary, because in some cases it does not exist any APC application in WebSocket log file.
  • Applications have to enter the read access to these application IDs via maintenance of the new authorization object “S_APC_WS”

  • If the caller user for RFC enabled function module “READ_WS_LOG” have not maintained any specific application IDs in the new authorization object “S_APC_WS” but has the authorization for transaction AL11, they can read all WebSocket log entries as they can do in AL11 as well.

  • PEER_ADDRESS_LIST; This list consists of the following components for peer as communication partner:
  • IP address of peer

  • Port number of peer

  • SEARCH_PATTERN; it is a string for regular expression. Using this pattern, you can select for erroneous WebSocket log entries or select for other important attributes from the WebSocket log file.
  • DESTINATION_ADDRESS_LIST; This list consists of the following components for endpoint as communication partner:
  • IP address, hostname or route string of the WebSocket destination server

  • Port number of endpoint as communication partner

  • This filter criteria can only be used for WebSocket client connections. The two entries correspond to the arguments provided in the call CL_APC_WSP_CLIENT*_MANAGER=>CREATE*.

  • Following example should describe the meaning of peer and destination addresses:

  • localhost --------------------- SAP Router ------------------- endpoint

  • 192.168.1.13/33333 192.168.2.12/3299 /H/saprouterhost/S/3299/endpointhost/63000

  • Peer IP Address is saprouter address: ,,,,192.168.2.12

  • Peer Port Number is saprouter port number: ,,3299

  • Destination IP Address is the route string to endpoint: /H/saprouterhost/S/3299/endpointhost

  • Destination Port Number is the port number of endpoint: 63000

  • Remark:
  • While processing queries for the data selection, the logical “OR” condition will be used for the entries of “APPLICATION_ID_LIST”, "DESTINATION_ADDRESS_LIST" or “PEER_ADDRESS_LIST” and the result will be presented with “AND” condition for all selection and filter criteria.
  • Example:

  • Application_ID list has the following entries:

  • ECHO

  • PING

  • All WebSocket log entries with application ID “ECHO” or “PING” will be selected

  • Peer Address list can have the following entries:

  • 127.0.* for IP-Address

  • 34* for Port Number

  • WebSocket log entries with IP-Addresses “127.0.*” or Port Number “34*” will be selected

  • Now, we select the WebSocket log entries with “AND” condition from “APPLICATION_ID_LIST” and

  • “PEER_ADDRESS_LIST” and other importing parameters from READ_WS_LOG function modules.

The function module “READ_WS_LOG” has the following optional exporting parameters:

  • RESULTS; This ITAB contains
  • APPL_SERVER; the name of application server, from that the WebSocket log files have been read

  • DIRECTORY_NAME; Directory name of WebSocket log files (see the value of profile parameter icm/WS/logging)

  • LOG_CONTENT; This is an ITAB for WebSocket log attributes like:

  • FILE_NAME

  • LINE_NUMBER

  • TIMESTAMP (system timestamp in long format)

  • EVENT_TYPE

  • DIRECTION

  • USER

  • CLIENT

  • APPLICATION_ID

  • LOCAL_IP_ADDRESS

  • LOCAL_PORT_NUMBER

  • PEER_IP_ADDRESS

  • PEER_PORT_NUMBER

  • DESTINATION_HOST

  • DESTINATION_PORT_NUMBER

  • WS_HANDLE

  • ROOT_CONTEXT_ID

  • CONNECTION_ID

  • CONNECTION_COUNTER

  • LARGE_MESSAGE

  • WS_TYPE (Message Type)

  • WS_FIRST_FRAME

  • WS_LAST_FRAME

  • WS_RESERVED_BITS

  • PAYLOAD_LENGTH

  • - ,,PAYLOAD (the WebSocket payload is max. 64 Kbytes).

  • Definition of Large Message: The field "large message" indicates that the message was too large to fit into one buffer. These messages are processed in multiple blocks. The line in the WebSocket log refers to the first block of this message only. Especially, the payload length of the log entry may differ from the real payload length, and at most the first part of the payload is written into the log entry.
  • ERROR_PROTOCOL; the application can find the result of error handling after call of function module “READ_WS_LOG”. The possible application errors could be:
  • WRONG_TIMESTAMP_INPUT

  • AUTHORITY_CHECK_FAILED

  • CHECK_SAME_SYSTEM_FAILED

  • AUTHORITY_CHECK_DATASET_FAILED

  • OPEN_DATASET_FAILED

In case that the application calls the function module “READ_WS_LOG” with the value abap_true for the flag “COLLECT_FROM_ALL_APPL_SERVERS”, the application may get the following system exceptions with different error texts from the problem situations:

  • SYSTEM_FALIURE

  • COMMUNICATION_FAILURE





Parameters

APPLICATION_ID_LIST
COLLECT_FROM_ALL_APPL_SERVERS
DESTINATION_ADDRESS_LIST
ERROR_PROTOCOL
PEER_ADDRESS_LIST
RESULTS
SAME_CLIENT
SEARCH_PATTERN
TIMESTAMP_FROM
TIMESTAMP_TO

Exceptions

Function Group

SAPC_WS_LOG

Addresses (Business Address Services)   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.

Length: 11104 Date: 20240523 Time: 154638     sap01-206 ( 116 ms )