“end diff “+
“FROM XI_AF_MSG ) “+
“where diff > 15”
*2) Suppress multiple alerts:* Communication channel polling interval is set to 15 minutes to enable check for such messages after every 15 minutes. A Dummy File Sender Channel is used: This CC is only used to set polling interval to 15 minutes as we don’t have Availability Time Planning feature in SP17. * JDBC Receiver CC used to call JDBC lookup: *
Once, a message satisfying above mentioned criteria is identified, an alert will be raised.
But as we are querying the database, after 15 minutes, same message will lead to another alert though this would have already been taken care of.
Hence, there should be a way to disable selection of same messages next time.
In XI JDBC scenarios, there is a section for Update query which is mandatory after select query. The purpose of this is to disable selection of same messages again and again.
But, we wouldn’t prefer to have direct update in Oracle database.
Hence, we have followed an alternative approach to achieve this.
We have created a Database table (zbxi_t0012) in XI ABAP stack .This table has two fields: XI Message ID and Message creation date.
*FUNCTION Z_ZBXI_SELECT_UPDATE_MSG_ID* FUNCTION Z_ZBXI_SELECT_UPDATE_MSG_ID. *”—- —————————————————————– *”*”Local Interface: *” IMPORTING *” VALUE(I_MSGID) TYPE CHAR40 *” EXPORTING *” VALUE(E_MSGID) TYPE CHAR40 *”—- —————————————————————– DATA: lt_zbxi_t0012 TYPE STANDARD TABLE OF zbxi_t0012, ls_zbxi_t0012 TYPE zbxi_t0012, itab_zbxi_t0012 TYPE standard table of zbxi_t0012 with header line, lv_msgid TYPE zbxi_t0012-msg_id, lv_date TYPE zbxi_t0012-creation_date, lv_refdate TYPE sy-datum, l_tst TYPE timestampl, tzone TYPE timezone, lv_creation_date TYPE TIMESTAMPL. lv_msgid = i_msgid. tzone = ‘UTC ‘. * Reference Date is taken as 3 months, so we wouldn’t check messages older than 90 days lv_refdate = sy-datum. lv_refdate = lv_refdate – 90. * Convert Reference date in timestamp format CONVERT DATE lv_refdate INTO TIME STAMP lv_date TIME ZONE tzone. *Get message creation date select single INITTIMEST into lv_creation_date from SXMSPMAST where MSGGUID = lv_msgid. * Populate creation date in a variable select single MSG_ID CREATION_DATE from ZBXI_T0012 into (lv_msgid,lv_creation_date) where MSG_ID = lv_msgid . * If message already exists in table(alert has already been raised) ,return a dummy message ID, which would be used in * XI mapping as a check that alert shouldn’t be raised in this case. if sy-subrc = 0. e_msgid = ‘00000000000000000000000000000000’. endif. *If message doesn’t exist in ZBXI_T0012, check if it is older than 3 months,if yes, return dummy message ID again,no alert * will be raised if sy-subrc <> 0. if lv_creation_date lt lv_date. e_msgid = ‘00000000000000000000000000000000’. * If message doesn’t exist in ZBXI_T0012, and if it is not older than 3 months ,update ZBXI_T0012 with this message, * return message ID,and raise an alert using XI mapping else. ls_zbxi_t0012-msg_id = lv_msgid. ls_zbxi_t0012-creation_date = lv_creation_date. INSERT zbxi_t0012 FROM ls_zbxi_t0012. e_msgid = lv_msgid. endif. endif. *Delete messages older than 3 months select * FROM ZBXI_T0012 into itab_zbxi_t0012 WHERE CREATION_DATE lt lv_date. if sy-subrc = 0. DELETE zbxi_t0012 from table itab_zbxi_t0012. endif. endselect. ENDFUNCTION. • JDBC lookup is used to select records which satisfy the above mentioned criteria. This UDF will return all such Message IDs *XI Message Mapping: *