(DI-2302) Collector for Cross-system RFC Locks

The technical name of the collector is /DVD/MON_CL_COL_RFC_LOCKS.

In a scenario where business processes are handled by multiple applications and accessing the same data, there needs to be a precaution that restricts applications from accessing data that is currently being processed by another application in a business process chain. This is what cross-systems locks (CSL) are for. The CSL is based on the token concept: Application programs that need to access the same data compete for a token that is assigned to this data. The program that owns the token can access the data. More information about CSL can be found at the SAP help portal for SAP Cross System Lock.

This collector collects information about cross-system RFC locks. It extracts information the same way as the transaction code SMCL. It can be parametrized and it is using input table, which has the same select options as the SMCL transaction. Additionally, the collector has implemented an enhancement spot, which could be used to automatically release these locks.

If CSL is active on the monitored system, but no token is found for the used token manager, the warning message No entry found in table ‘CSL_MTLK’ for CSL token manager '<TOKEN_MANAGER>' is raised. Otherwise, if CSL is not active on the monitored system, no message is raised.

On version 2211 and lower, if no token manager is found (regardless of whether CSL is active or not), the error message CSL: No hit in token manager <TOKEN_MANAGER> is raised. To resolve this error, it is recommended to upgrade to the latest available version.

Default KPIs delivered with this collector

The following default KPIs are delivered with this collector:

KPI name

Description

Unit

Detail table

KPI name

Description

Unit

Detail table

RFC_LOCK_ALL

Number of all Cross-System RFC Locks

Count

Yes

RFC_LOCK_LONG

Number of long-running Cross-System RFC Locks

Count

Yes

Input table

Collector uses input table /DVD/MON_LCK_RFC where the user can specify what details will be extracted into detail table /DVD/MON_S_RFC_LOCKS.

If the input table /DVD/MON_LCK_RFC does not provide any record, the default CSL token manager is loaded by using the function module CSLTM_GETTOKENMANAGER. The collector is reporting, by default, all locks since the last collector's run or all existing locks that are not older than one day.

Input table /DVD/MON_LCK_RFC supports wildcards for the following fields:

  • TOKEN_HOME_SYSTEM

  • OBJECT_TYPE

  • USERNAME

These fields reflect the same functionality for defining inputs as transaction SMCL.

Fields MSY and MNU must be fully specified.

Technical name

Description

Technical name

Description

MSY

Remote system of token manager

MNU

Number of token manager

TOKEN_HOME_SYTEM

Home system of token manager

OBJECT_TYPE

Key for the lock object type

USERNAME

User who initiated token lock

Parameters

The following parameters are used for this collector:

Parameter name

Description

Parameter name

Description

RFC_LOCK_LONG_THRESHOLD

Used for KPI RFC_LOCK_LONG. Specifies how many seconds must lock exist to be reported as long-running. Default 300 seconds (5 min).

RFC_LOCK_DAY_THRESHOLD

Specifies how many days should a collector look back to collect lock details. By default, when the collector runs for the first time or the last run timestamp is not defined, this threshold is used. Otherwise, all locks are collected since the last run.

Detail table

The collector provides a detailed table for RFC Cross System Lock Details. The technical name of the detail table is /DVD/MON_S_RFC_LOCKS.
RFC Cross System Lock Details reports all cross-system RFC locks currently in place created in the last 24 hours.

Technical name

Description

Technical name

Description

TIMESTAMP

Time when the records are saved into the detail table

SID

System ID

TOKEN

Token

TOKEN_MANAGER

System of Token Manager

TOKEN_MANAGER_NUM

Number of Token Manager

STATUS

Status of Assignment Token Manager to Token

USERNAME

User Who Initiated Token Lock

LAST_TIME_ACCESS

Last access timestamp for RFC lock formatted

AGE

Amount of minutes lock was not accessed

EVENT_TIMESTAMP

Same as field LAST_TIME_ACCCES (only used for overriding AppDynamics analytics timestamp)

Enhancement Spot

You can use collector run to automatically release all locks collected over the past 24 hours. There is an enhancement spot with BAdI /DVD/MON_BAD_RFC_LOCKS, with an interface that contains the method RELEASE_LOCKS.

In created implementation call function module CSLAR_TKCHANGE with parameters already provided through the interface:

FM Parameter

Variable

FM Parameter

Variable

PCOMM_ROUTING_INFO

IS_ROUTING_INFO

BNAME

SY_UNAME (or any name you wish to release locks under)

PUCOMM

DELE

PCOMM_CALLED_CPPS

IT_CALLED_CPPS

TO_CHANGE_TOKEN

IT_TOKENS

This function module will automatically release all RFC locks collected by the collector. If you wish, you can also implement additional functionality in this implementation (logging, another action that needs to be done after lock release, etc.).

Example Code for releasing all collected locks:

CALL FUNCTION 'CSLAR_TKCHANGE' EXPORTING pcomm_routing_info = is_routing_info bname = sy-uname pucomm = 'DELE' TABLES pcomm_called_cpps = it_called_cpps to_change_token = it_tokens EXCEPTIONS no_connection = 1 no_alobject = 2 internal_error = 3 OTHERS = 4. IF sy-subrc <> 0. /dvd/cx_mon_exception=>raise_from_system_message( ). ENDIF.