Sender and receiver information for messages stuck in SMQ2 in PI.
Many times in support projects, we face issues with PI Message queues. If there is any issue with Java stack, messages will get stuck in SMQ2. While working in support project I learned one thing. It is important to resolve the issue, but it is even more important to analyze the situation and keep business informed.
In Crisis situations, the most important task is to give data to Business. If you say 3000 messages are stuck in SMQ2 because of JCO error in java stack, users won’t be able to understand. For Business, required information is the number of warehouses that are getting affected, count of partners that are not able to send messages to R3 etc.
We can provide this information from MONI. However, the problem is extracting data from MONI based on message status is a very time consuming task. In my previous project, we have to provide partner wise details to business every 30 mins. For such situation, we can directly extract information from SAP PI Standard tables. In this document, I will share the process we followed to get partner wise details for messages stuck in SMQ2.
We used 2 master tables in PI. First one is SXMSPMAST (everyone is aware of this table) and the second is SXMSPEMAS.
Structure for SXMSPMAST
Structure for SXMSPEMAS.
SXMSPMAST table contains STATUS information for all messages flowing via PI. Field MSGSTATE contain the status of each message ( for more details on all available status please check SXMSMSTAT).
For messages stuck in SMQ2, message status will be '12' or '1'. We need to extract messages ID of messages with status ‘12’ or’ 1’. To make this extraction fast, you can only select relevant fields in the output (Go to SettingsàFormat Listà Choose Field.--> Deselect all and select only MSGGUID, MSGSTATE and EXETIMEST fields. ).
Once we get the message ids, we have to use these to extract sender and receiver details from table SXMSPEMAS. From this table, we will get sender/receiver information of all messages that are stuck in SMQ2. We can write a program, or can manually get the required information.
You can extract this information manually or you can write a report which will get data from these two tables and will return the information in desired format. Either way, it will save a lot of time and effort that is required in extracting same information from SXMB_MONI.
Please share your views on this. Also let me know if there is another better and efficient way to do this.