Skip to end of metadata
Go to start of metadata

Enhancing Alerts in Alert Monitor

This page outlines how to use BADI user-exit to enhance Alert data displayed in the Alert Monitor.
The first step in enhancing the alerts displayed in Alert Monitor is to understand how Alerts related data is stored in APO. The next step will be to enhance the data using the BADI user-exit enhancement provided by SAP.

Basically there are Database and Dynamic Alerts.
The data for Database Alerts is generated typically by running a macro and the alert information gets stored in a database table /SAPAPO/AM_ALERT.
On the other hand Dynamic Alerts as the name suggest are generated "on the fly" based on standard SAP code and the information gets stored in Structures.

All alerts be it database or dynamic get displayed using either the stand-alone Alert Monitor (transaction code /SAPAPO/AMON1) or application-specific Interactive Transactions with suitable Alert Profile selected under Settings >> (Assign) Alert Profile.
For example in Interactive Demand Planning (transaction /SAPAPO/SDP94) alerts get displayed at the bottom of Interactive Planning Table when the Display/Refresh Alerts button is toggled on. Note for Interactive Demand Planning most alerts are Database Alerts.
Likewise in Product View (transaction code /SAPAPO/RRP3) you assign a suitable PPDS Alert Profile which will display the relevant Dynamic Alerts.

Alerts (identified by Alert IDs data element /SAPAPO/C_ALERT_ID) are grouped into Alert Types (data element /SAPAPO/C_ATYPE) which in turn is aggregated into Alert Object Types (data element /SAPAPO/C_AOTYPE).

Table /SAPAPO/AOTYPES provides a complete list of Alert Object Types which also links the structures containing the alert information.
For example "Order in Past" is Alert Object Type "0055" belonging to Application "PP" i.e. PPDS and the data for alerts is contained in structure "/SAPAPO/ORDER_IN_PAST_ALERTSTR"

Take a look at /SAPAPO/AMON_SETTING transaction where Alert Profile is set up. Here for a particular application (like PPDS) the Alert Types get displayed under which the actual Alerts are grouped.
For example under PPDS Application tab, Alert Types like Requirement/Receipt, Order in Past etc. Alert Object Types are listed. Expanding one of them like the Order in Past lists the different (dynamic) Alert Types possible like Sales Order in Past, Receipt Due Date/Time in Past, Start Date in Past, Opening Date in Past, Sales Scheduling Agreement in Past.

The Method MODIFY_ALERTLIST is used to change values in the Alert Structures so that the ultimate alert data displayed is enhanced.
FM /SAPAPO/ATAB_ATYPES_APPL_GET can be used to get the Alert Object Types for a given Application (e.g. PP for PPDS).
From the alert structure the Product (MATID), Location (LOCID) and Planning Version (PLVER) can be read which can be used to build the basis for the logic to enhance the alert data. The Location-Product master details can be fetched using FM /SAPAPO/DM_MATLOC_GET.
Technically the data in the Alert Stucture is extracted using Field Catalog (FM /SAPAPO/ATAB_FIELDCAT_GET) into an internal table for processing.

back to top

  • No labels

1 Comment

  1. Unknown User (tptutqp)

    Hi, let me have a side comment regarding the generation / determination differences between database- and dynamic alerts:

    1. Database Alerts: these are generated by macros that should run as part of the Process Chains in the background, and saved in the database. When a planner determines alerts in the Alert Monitor, alerts are selected from the database and displayed according to their own alert profile. These alerts are "static", you need to take care of deleting / updating them periodically (the alert generation job should include these housekeeping steps). Since they are typically refreshed once a night, planners will not have up-to-date alerts
    2. Dynamic Alerts: these are generated by macros as well, however, not during the night process runs, but when you determine alerts in the Alert Monitor. Technically, the Alert Monitor opens the Planning Book(s) specified in the planners' Alert Profiles, and executes the default macros. So Dynamic alerts are refreshed each time you display alerts of an appropriate alert profile in Alert Monitor. As a consequence, alert determination might take longer than displaying previously created database alerts. To enhance the performance of the Alert Monitor, you can set a job to determine specific Alert Profiles periodically (like 1 or 2 hours), and save the alert situation. Then planners can display these saved alert situations instead of refreshing alerts on-the-fly, from the same initial screen of Alert Monitor. An additional difference applies for the deletion of dynamic alerts. You needn't and cannot manually delete such alerts, they are eliminated once the cause (like a shortage) disappears