|
The MRS solution provides you the architecture to create your own alerts based on custom code and view them in alert monitor in planning board. It is very easy to do this. Before you proceed from here, it is expected that you must read the IMG Node documentation of following nodes: - Set Up Scheduler Workplace -> Workplace Profiles -> Check Profile -> Define Classes for Performing the Checks
- Set Up Scheduler Workplace -> Workplace Profiles -> Check Profile -> Define Check Profiles
- Set Up Scheduler Workplace -> Workplace Profiles -> Alert Profile -> Define Alert Types
- Set Up Scheduler Workplace -> Workplace Profiles -> Alert Profile ->Define Alert Profiles
After reading the above mentioned documentation you need to do the following:
Step 0: Create a new message type in SE91. This will be the message that appears in the alert monitor. Step 1: Create a new check class. Let's call it ZCL_MY_CHECKS. This class must implement the interface /MRSS/IF_SGE_CHECK. Here you need to define all 4 methods of this interface. CHECK_PERFORM : This method is called when the planning board is launched. This method imports all the data from the planning board and this data can be used to create alerts. INITIALIZE : This method is called at the initialization of the planning board. Here you can populate some global variables etc. This method will import the reference of Alerts, Resource manager, Work list and Clocking interface. These references will be used to get the global buffered data of MRS application. IS_TIME_DEPENDENT : This method is called to check if a particular check class is time dependent or not. Here, you just have to return the RETURNING flag as 'X' or ' '. If 'X' is returned then it means that the checks in this class will be called at a periodic interval of time. It is useful if you have certain checks that depend on time. So these checks have to be carried out at a regular interval of time. CHECK_PERFORM_CHANGE : This method is called whenever a object (assignment, demand, time allocation etc) is changed in MRS engine. This method imports the changed data object of type : /MRSS/CL_SGE_DATA_CHANGED. Here, to identify if an assignment was changed or demand was changed, you can use the attribute GV_OBJECT_TYPE of this changed object. Note: This class /MRSS/CL_SGE_DATA_CHANGED is abstract and is inherited by many classes. Based on the type of object changed, you can typecast it to the specefic class and then use the attributes of the inherited classes.
Step 2: When implementing the methods in your class ZCL_MY_CHECKS you need to write your check code in CHECK_PERFORM and CHECK_PERFORM_CHANGE. Here, first you need to collect all your alerts in one internal table.The type of internal table must be: /MRSS/T_ALERTDATA_TAB. Here you will fill the table with the message created in Step 0 above. Alert components and types: When creating alerts you need to provide the component type and guid. The component is the object for which alerts is created. For e.g. if I create a alert for resource unavailability, then the component type will be 'D' for resource and the component guid will be resource guid. Also, we can populate additional components for an alert message. For e.g. in this case I can populate the Assignment guid and Demand guid in additional components. This is populated in structure: /MRSS/T_ALERTDATA. The methods of object for alerts (imported in INITIALIZE method above) must be used to create, modify, delete alerts. Check the methods provided by interface: /MRSS/IF_SGA_ALERT_INT. In your coding, you should only call the methods of this interface to create or modify alerts. Step 3 - Customization: - Add you class to list of check classes. This will be done in: Set Up Scheduler Workplace -> Workplace Profiles -> Check Profile -> Define Classes for Performing the Checks. When you do this, your calss will also be called when ever checks for alerts are called.
- Add your check class in your check profile. This check profile is in turn linked to the planning board profile. This is done in: Set Up Scheduler Workplace -> Workplace Profiles -> Check Profile -> Define Check Profiles
- Define your new alert type in customizing : Set Up Scheduler Workplace -> Workplace Profiles -> Alert Profile -> Define Alert Types
- Define your new alert message number in your alert profile. This is done in customizng: Set Up Scheduler Workplace -> Workplace Profiles -> Alert Profile ->Define Alert Profiles
That's all. Then launch your planning board and your checks and alerts are active.
|