MDLP Note 2021_03_4
Document History
Version | Changes | Effective Date |
1.0 | First approved version 3Keys MDLP Add-On Note 2021_03_4 | 27-Jul-2021 |
1. Overview
This document describes changes in the 3Keys MDLP connector ABAP part.
2. Description
Runtime error on program /K3T/RU_OMS_TOKEN when program run first time if more than one OMS system is configured for dynamic token.
In some cases, BR_CRYPTO_COMM reporting event failed with token related error:
The reason is overlap of update token process by program /K3T/RU_OMS_TOKEN and read token by BR_CRYPTO_COMM reporting event processing logic. To fix this problem lock mechanism added into program /K3T/RU_OMS_TOKEN and additional ABAP code with lock check and delay logic needs to be added into enhancement before token reading from database.
Implementation error.
New option added into program /K3T/RU_OMS_TOKEN to execute ping specified system. Ping result is available at SLG1 application log.
Selection screen:
New feature
Enhancement class /STTP/CL_SAFE_DATA method GET_DATA
As described at Note 2021_02_6 SAP standard code uses static buffer on reading Safe Storage value and it is necessary to reset buffer for dynamic OMS client token to get updated value from Safe storage database using implicit enhancement at method GET_DATA of class /STTP/CL_SAFE_DATA.
In some cases, update token by program /K3T/RU_OMS_TOKEN and reading token from database could be run in parallel. To avoid reading old token value additional check if token is locked by update program need to be implemented before read token from database. If token is locked program wait 1 second and repeat lock check (maximum 60 attempts with delay 1 second).
If for some reasons it is necessary to correct maximum attempts number please use parameter table /K3T/RU_PARAM (parameter name /K3T/DYN_TKN_LOCK_DELAY, value example 60).
To maintain parameter the following options available:
transaction /K3T/RU_PARAM (required transport request)
transaction SM30 view /K3T/RU_PARAM_V (transport request is not required)
Enhancement example:
ABAP code:
*Enhancement for Dynamic token: Reset buffer for OMS client token to get updated token from Safe Storage DB table (updated by 3Keys Note 2021_02_06)
IF iv_content_key CP '*OMS*CLIENTTOKEN'.
CONSTANTS lc_lock_gname TYPE seqg3-gname VALUE 'TRDIR'.
DATA:
lt_enqueue_info TYPE STANDARD TABLE OF seqg3,
lv_arg TYPE seqg3-garg,
lv_system TYPE string,
lv_dyn_token_sec_delay TYPE i VALUE 60.
lv_system = substring_after( val = iv_content_key sub = 'RR' ).
lv_system = substring_before( val = lv_system sub = '_CLIENTTOKEN' ).
lv_arg = 'TKN_' && lv_system.
IF sy-cprog <> '/K3T/RU_OMS_TOKEN'.
DATA(lv_delay_cust) = /k3t/cl_rr_ru_utils=>get_parameter( '/K3T/DYN_TKN_LOCK_DELAY' ).
IF lv_delay_cust IS NOT INITIAL.
lv_dyn_token_sec_delay = lv_delay_cust.
ENDIF.
DO lv_dyn_token_sec_delay TIMES.
"Check Token for requested system is currently locked by token update program
"and wait until token update process finish and release lock
CALL FUNCTION 'ENQUEUE_READ'
EXPORTING
gname = lc_lock_gname
garg = lv_arg
guname = ''
TABLES
enq = lt_enqueue_info
EXCEPTIONS
communication_failure = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc EQ 0 AND
lines( lt_enqueue_info ) > 0.
CALL FUNCTION 'ENQUE_SLEEP'
EXPORTING
seconds = 1
EXCEPTIONS
system_failure = 1
OTHERS = 2.
IF sy-subrc <> 0.
"stop waiting and continue processing
EXIT.
ENDIF.
ELSE.
"stop waiting and continue processing
EXIT.
ENDIF.
ENDDO."Delay in seconds until token will be unlocked
ENDIF."called from program /K3T/RU_OMS_TOKEN
SELECT param_value
INTO TABLE @DATA(lt_stat_token_systems)
FROM /k3t/ru_param
WHERE param_name LIKE '/K3T/OMS_STATIC_TOKEN_SYST%'.
LOOP AT lt_stat_token_systems INTO DATA(lv_stat_token_system).
IF iv_content_key CS lv_stat_token_system.
"leave static token without changes
ELSE.
"delete buffer line for this dyn token to read updated value from Safe Storage DB table
DELETE st_savedata WHERE content_key = iv_content_key.
CONTINUE.
ENDIF.
ENDLOOP.
IF lines( lt_stat_token_systems ) EQ 0 .
"delete buffer line for this dyn token to read updated value from Safe Storage DB table
DELETE st_savedata WHERE content_key = iv_content_key.
ENDIF.
ENDIF.
3. Solution
Import related to the transport request.
3.1 Correction instruction FP04
Transport request | Description / Dependencies |
AT1K900807 | 3Keys Russia MDLP Add-On FP04 Note 2021_03_04 Required transport AT1K900728 |
3.2 Correction instruction FP05
Transport request | Description / Dependencies |
D1AK900331 | 3Keys MDLP Add-On FP05 Note 2021_03_04 Required transport D1AK900283 |
3.3 Correction instruction ATTP 3.0
Transport request | Description / Dependencies |
A1DK900195 | 3Keys MDLP Add-On 3.0 Note 2021_03_04 Required transport A1DK900159 |
4. Recommendation
Correct custom implicit enhancement to check token system lock due to token update and delay N seconds on reading OMS token from Safe Storage according to section Enhancement class /STTP/CL_SAFE_DATA method GET_DATA
Create background job to ping OMS system periodically with program /K3T/RU_OMS_TOKEN.
5. Source code objects
Short description | Program | Object type | Object name |
Translation for: Single Message | LANG | MESS | /K3T/REP_RU178 |
Translation for: Single Message | LANG | MESS | /K3T/REP_RU179 |
Translation for: Single Message | LANG | MESS | /K3T/REP_RU180 |
Translation for: Report Source Code | LANG | REPS | /K3T/RU_OMS_TOKEN |
Translation for: Report Texts | LANG | REPT | /K3T/RU_OMS_TOKEN |
Documentation | LIMU | DOCU | NA/K3T/REP_RU178 |
Documentation | LIMU | DOCU | NA/K3T/REP_RU179 |
Documentation | LIMU | DOCU | NA/K3T/REP_RU180 |
Single Message | LIMU | MESS | /K3T/REP_RU178 |
Single Message | LIMU | MESS | /K3T/REP_RU179 |
Single Message | LIMU | MESS | /K3T/REP_RU180 |
Report Source Code | LIMU | REPS | /K3T/RU_OMS_TOKEN_C01 |
Report Source Code | LIMU | REPS | /K3T/RU_OMS_TOKEN_SSC |
Report Texts | LIMU | REPT | /K3T/RU_OMS_TOKEN |
Domain | R3TR | DOMA | /K3T/RU_NOTE2021_03_04V1 |
Domain | R3TR | DOMA | /K3T/RU_NOTE2021_03_04V2 |