Sometimes you want to know whether an IDoc has a minimum number of segments, a maximum number or a value within a defined range (e.g. to make sure that a reasonable number of time records has been transferred).
As the classic IDoc monitoring object is not suitable for this use case, in this blog post I will describe how to easily achieve this with a Table Entry Counter.
To be monitored: Number of segments of a single IDoc (Transaction Code BD87)
(Optional): Have a look at the IDoc monitor
As a first idea, one could try to employ the IDoc (Real-time Monitoring) metric.
"Count Segment (Expert field): Count the number of all segments with this segment name, e.g. E1EDP01. Please note: You cannot set a threshold on this field and i.e. filter only for IDocs that have a certain segment. The information collected here is only used for the content view in the IDoc detail list."
IDoc Monitoring Object (Count Segment field)
Furthermore, using the "Header Field" with MAXSEGNUM less than (LT) 10,000 as a filter does also not work. In this example only four IDocs have less than 10,000 segments, while the monitor returns a value of six.
Let´s assume that at least 10,000 segments are expected for each IDoc of message type RPM_TIME, otherwise there is an issue with this interface or the system that creates these data.
The monitor should only consider IDocs which have been created on the current day, so you can use of variable $TODAY for setting the date dynamically (more information about variables by klicking "Display Help for Monitor" above the "Parameters on Object Level" section).
Table Entry Counter (Configuration)
Check the Number of Counted Entries box and enter 0 in the parameter set below for "RED, if more than" so that an alert is raised if at least one IDoc meets the filter criteria.
Table Entry Counter (Key Figure and Parameter Set)
Adapt the data collection and activate, if required, email notifications or incident creation in case of an alert according to your requirements.
Table Entry Counter (Data Collection)
Table Entry Counter (Notifications and Incidents)
Check the database table EDIDC with your selection criteria to find out the correct number of IDocs that should be returned by the monitor.
Table EDIDC (Transaction Code SE16)
Business Process Monitoring
After the monitor has run, check the status of the monitor in the Business Process Monitoring Application.
Since the data to be monitored is stored in a transparent table, it can be monitored with a generic Table Entry Counter monitor, even if there is no fitting out-of-the-box object available in the KPI Catalog.
All screenshots were taken by me in SAP Solution Manager 7.2 SPS11 (Managed System: ST-PI 740 SP13 ST-A/PI 01U_731 SP00 according to SAP Note 521820)