Skip to content

Commit

Permalink
Merge pull request #14 from RegestaItalia/tmsAlert
Browse files Browse the repository at this point in the history
add tms alert
  • Loading branch information
simonegaffurini authored Jul 3, 2024
2 parents f812c3d + 51c358b commit 26e0760
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/zif_trm.intf.abap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
INTERFACE zif_trm
PUBLIC .

CONSTANTS version TYPE string VALUE '1.3.0' ##NO_TEXT.
CONSTANTS version TYPE string VALUE '1.3.1' ##NO_TEXT.

ENDINTERFACE.
7 changes: 7 additions & 0 deletions src/ztrm.fugr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1519,6 +1519,9 @@
<RSEXC>
<EXCEPTION>READ_QUEUE_FAILED</EXCEPTION>
</RSEXC>
<RSEXC>
<EXCEPTION>TMS_ALERT</EXCEPTION>
</RSEXC>
</EXCEPTION>
<DOCUMENTATION>
<RSFDO>
Expand All @@ -1537,6 +1540,10 @@
<PARAMETER>READ_QUEUE_FAILED</PARAMETER>
<KIND>X</KIND>
</RSFDO>
<RSFDO>
<PARAMETER>TMS_ALERT</PARAMETER>
<KIND>X</KIND>
</RSFDO>
</DOCUMENTATION>
</item>
<item>
Expand Down
30 changes: 29 additions & 1 deletion src/ztrm.fugr.ztrm_read_tms_queue.abap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FUNCTION ZTRM_READ_TMS_QUEUE.
FUNCTION ztrm_read_tms_queue.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
Expand All @@ -8,26 +8,54 @@ FUNCTION ZTRM_READ_TMS_QUEUE.
*" EXCEPTIONS
*" TRM_RFC_UNAUTHORIZED
*" READ_QUEUE_FAILED
*" TMS_ALERT
*"----------------------------------------------------------------------
DATA: ls_bufcnt TYPE tmsbufcnt,
ls_alog TYPE tmsalog.

CALL FUNCTION 'ZTRM_CHECK_AUTH'
EXCEPTIONS
trm_rfc_unauthorized = 1.
IF sy-subrc EQ 1.
RAISE trm_rfc_unauthorized.
ENDIF.

" 03072024 avoid display alert
sy-batch = 'X'.

CALL FUNCTION 'TMS_UIQ_IQD_READ_QUEUE'
EXPORTING
iv_system = iv_target
iv_collect = 'X'
iv_read_shadow = 'X'
IMPORTING
et_requests = et_requests
es_bufcnt = ls_bufcnt
EXCEPTIONS
read_queue_failed = 1.

IF sy-subrc EQ 1.
RAISE read_queue_failed.
ENDIF.

IF ls_bufcnt-alertid IS NOT INITIAL.
CALL FUNCTION 'TMS_ALT_ANALYSE_ALERT'
EXPORTING
iv_alert_id = ls_bufcnt-alertid
iv_no_display = 'X'
IMPORTING
es_alog = ls_alog
EXCEPTIONS
alert = 1
error_message = 2
OTHERS = 3.
IF ls_alog-msgty EQ 'E' OR ls_alog-msgty EQ 'A'.
MESSAGE ID ls_alog-msgid
TYPE ls_alog-msgty
NUMBER ls_alog-msgno
WITH ls_alog-msgv1 ls_alog-msgv2 ls_alog-msgv3 ls_alog-msgv4
RAISING tms_alert.
ENDIF.
ENDIF.

ENDFUNCTION.

0 comments on commit 26e0760

Please sign in to comment.