Skip to Content
Technical Articles
Author's profile photo Santhosh Kumar Vellingiri

SAP XI/PI: Alerts for Queue Errors

Alerts can help us so much with the monitoring of the Exchange Infrastructure. Till now there are Blogs, which tells how to create alerts for Monitoring Errors, Imagine the luxury of Alerts being created for the errors in Inbound and Outbound Queues.

In most of the support projects it is always a mechanical task to check for errors in Queues (SMQ1 & SMQ2) very frequently. An Alert creation for this task will less the burden of queue monitoring and will enrich the usage of the alerts in monitoring space.

Through this Blog I would walk through with the steps to create Queue Alerts. The task here is broken into two-piece.

1. Programming with the qRFC API to obtain the Queue Information.

2. Alert Category creation and triggering Alerts from the Program.

qRFC API’s :

TRFC_QOUT_OVERVIEW – This function module gives an overview of the current outbound queues that exist for various optional import parameters, for example, queue name, destination, SAP client.

TRFC_QIN_OVERVIEW – This function module gives an overview of all the inbound queues that currently exist for various optional import parameters, for example, queue name or SAP client.

Alert API:

SALERT_CREATE – This Function module is used to create alert by importing parameters like alert category, Container name and its value.

Let us now look at the steps to create queue alerts.

Step 1:

Create an Alert Category QUEUE_ERR (T-Code: ALRTCATDEF) with the following Containers.

Step 2:

Add the Message Title, Short, Long Text and you SAP logon id in Fixed Recipients list.

Stuck with Alert creation..? Refer Michal’s Blog  The specified item was not found.

Step 3:

Create a report Z_QUEUE_ALERT in SE38.

Copy paste the below source code to check the queues and create Alert for queues with the Status SYSFAIL.

Step 4:

Schedule this report using SM36 to check and trigger alert time after time.

With this above four steps you are ready to receive a Alert message in RWB Alert Inbox as below and an email to the smtp address maintained for your SAP logon id in SU01.

Assigned Tags

      14 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      Good (and most important) useful blog!

      Congratulations,

      David R.

      Author's profile photo Former Member
      Former Member
      Thanks for this article. I think this could be useful for CIF error handling as well between R/3 and APO/SCM boxes.
      Author's profile photo Former Member
      Former Member
      Good blog.
      Author's profile photo Former Member
      Former Member
      Definitly a good one. I was looking out for a easy solution than configuring CCMS.

      I think there is typo, you have mentioned to create report in SM38.

      Anish

      Author's profile photo Santhosh Kumar Vellingiri
      Santhosh Kumar Vellingiri
      Blog Post Author
      Thanks Anish....! Corrected that typo  🙂

      ~SaNv...

      Author's profile photo Former Member
      Former Member
      Thanks a lot for the wonderful blog, this really eased my life in the current support assignment where I need to run through SMQ1 and SMQ2 every hour on three different instances.

      Author's profile photo Jan Noorland
      Jan Noorland
      Looks like a quick alternative to configuring CCMS.
      Just one omission, what would you set as the alert rule? If you'd set a rule with no restrictions any alert in PI will result in an e-mail about a qRFC error.

      Thanks,
      Jan.

      Author's profile photo Volker von Gloeden
      Volker von Gloeden
      Everybody enjoying this blog should also have a blog from Johannes Fleig in 2008 which describes an even easier and more flexible qRFC alert monitoring with the help of Business Process Monitoring in SAP Solution Manager.

      New Business Process Monitoring functionalities in SAP Solution Manager – qRFC Monitoring

      No need to program an API. You get the following key figures out of the box

      Status Monitoring

      •          Number of entries with critical status in group

      •          Age of oldest critical status in group

      •          Combination of "Entries" and "Age" in critical state

      •          Number of entries with interim status in group

      •          Age of oldest interim status in group

      •          Combination of "Entries" and "Age" in interim status

      Backlog monitoring

      •          Number of individual queues in group

      •          Total number of entries in all queues of group

      •          Average number of entries per queue in group

      •          Maximum number of entries per queue in group

      •          Age of oldest entry in group

      •          Combination of "Total entries" and "Oldest age"

      Or you visit https://service.sap.com/bpm --> Media Library --> Technical Information --> Setup Guide for Interface Monitoring.pdf

      and learn more about qRFC, tRFC, IDOC, File, Batch Input and XI/PI monitoring with BPMon.

      Regards
      Volker

      Author's profile photo Former Member
      Former Member
      What is the easiest way to cause an error that will test this?  I would prefer not to wait for such an error to occur naturally.

      Thanks,
      Keith

      Author's profile photo Santhosh Kumar Vellingiri
      Santhosh Kumar Vellingiri
      Blog Post Author
      Deregister a queue in SMQR and try testing...

      ~SaNv...

      Author's profile photo Former Member
      Former Member

      Any one can find several blogs on how to create alert for errors coming in SAP PI but this blog is quite different and really very helpful.

      Good Work Santosh... keep it going.

      Thanks

      Sandeep Sharma

      Author's profile photo Former Member
      Former Member

      Hi Santosh,

      Is this still works in new PI (PI 7.30 onwards) environment?

      In runtime workbench, do you still have to create a rule for it? Any specific details with the rules if mandatory since the program only refers to queue not related to PI interfaces?

      Cheers,

      R-jay

      Author's profile photo Former Member
      Former Member

      Hi,

      Very good information.

      Regards,

      Alka.

      Author's profile photo Mario Candian
      Mario Candian

      Hi Santhosh.

      Very nice. I followed the howto, but the alerts that I received not show the content of container: ZDIR, ZQUEUE, ZQUEUE_NO and ZERROR.

       

      My container has this:

      And my text describe this:

      What can I be doing wrong? Can you help me?

       

      Regards,

      Mário