Additional Blogs by SAP
Showing results for 
Search instead for 
Did you mean: 

1.        General Information

Based on our ITSM and Change Management project, we sometimes get requirement from customer to send email to specific recipient when status changes, e.g. to send email to processor when Incident status is changed from NEW to IN PROCESS, and also when status is changed from CUSTOMER ACTION back to IN PROCESS, email also has to be triggered to processor or other partner functions. For this situation, if as what we always defined, to set schedule condition “user status = in process(E0002)”, when status is set to IN PROCESS, both emails will be triggered which is not what we expect. So what we need is to trigger different emails when status is changed from different old statuses.

2.        Design

Refer to Note 1275036 - Linking action execution and status change, we can take use of BADI implementation AGS_SDK_SCHED_ST_CHD and define old status value and new status value in action condition (e.g. in schedule condition).

3.        Configuration Steps

Out example is send email to Message Processor when status is changed from CUSTOMER ACTION to IN PROCESS, and send email to REPORTED BY when status is changed from PROPOSED SOLUTION to IN PROCESS.

To achieve this we have to define two PPF Actions and off course two action conditions accordingly.

3.1 Action Definition

According to the Note, when define actions, we choose “Conditions Using Business AddIn (BAdI)” for the Rule Type.

3.2 Action Condition

In the Table Schedule Condition, use F4 to choose BAdI implementation AGS_SDK_SCHED_ST_CHD for schedule condition.

Then click button “Define Parameters” to define the old status and new status parameters.

Pay attention to the pop up dialog when clicking the button, it tells that “If you change the parameter definition, this affects existing conditions in other action definitions If values have already been maintained, they are initialized after the change Do you want to change the definition?”, meaning that all actions which are using this BAdI implementation, they share same parameter definition.

Follow below instrunctions in the note to set the new user status parameter:

  • Element: USER_STATUS
  • Description: New user status
  • Short Descript.: New user status for which the action is executed (with status change)
  • Enter the data type ABAP Dictionary Reference Structure: TJ30, Field: ESTAT
  • Properties: Select the "Multiline" indicator.
  • Initial value: Enter the status values (after the status change) for which the action is to be executed, for example E0003 (the action is then executed when there is a status change to one of these status values).

For Old User Statuses, if you have similar situation as my example, to trigger more emails from different old status, you have to leave the initial value empty for parameter Old User Statuses.

Then you can maintain the value of the parameter. For exmaple if you want to send email when status is changed from E0005(proposed solution) to E0002, set the USER_STATUS to E0002, and the USER_STATUS_OLD to E0005.

For the other one (E0003->E0002) maintain the value as below:

3.3 Result

After above configuration, when you process incident ticket, from CUSTOMER ACTION to IN PROCESS, email action will be triggered, and when PROPOSED SOLUTION to IN PROCESS, different email action is triggered.

Tested with expected result in internal system.

4.        Reference Information

1275036 - Linking action execution and status change (The reason why I write this document is because we have some misunderstanding when using this Note).