Supply Chain Management Blogs by Members
Learn about SAP SCM software from firsthand experiences of community members. Share your own post and join the conversation about supply chain management.
cancel
Showing results for 
Search instead for 
Did you mean: 
kevin_wilson2
Contributor

SAP provides the ability to create alerts (emails) through the Alert Framework. Other modules, like SAP Event Management, integrate with the Alert Framework in order to send notifications on exceptions uncovered in the process.

The text that is maintained in the Alert Category definition (tx: ALRTCATDEF) is either static or mapped in from the called system (e.g. SAP EM).

http://3.bp.blogspot.com/-rKDvw9G0BOM/VUPlICfOnSI/AAAAAAAAApA/pI9_BcK4hxQ/s1600/alert.JPG

At times we need to have the ability to manipulate the resulting mapped text. To do this you can use BAdI ALERT_MODIFY_TEXT. Note that the BAdI requires filter values relating to your Alert Category Class. See values for my scenario below.

http://3.bp.blogspot.com/-PKdhcWarbqc/VUPmJ2ZOTbI/AAAAAAAAApE/T0pJZkMAfJ4/s1600/badi_alert.JPG

The method to implement is called MODIFY_LONG_TEXT

Scenario: We need to replace the uppercaps with Lowercaps for TORONTO...


Sample code:

DATA: lv_line TYPE soli.
*IP_LANGU         TYPE SYLANGU              Language
*IO_ALERT         TYPE REF TO CL_ALERT      Alert
*value( FLT_VAL ) TYPE SALRTSCLSC  Parameter FLT_VAL of Method MODIFY_LONG_TEXT
*IP_LOGHANDLE     TYPE BALLOGHNDL OPTIONAL  Application Log: Log Handle
*IP_APPL_GUID     TYPE GUID_32              Application GUID
*CT_LONG_TEXT     TYPE SOLI_TAB   OPTIONAL  Long Text
*CP_TEXT_TYPE     TYPE SO_OBJ_TP  OPTIONAL  Text Type
*FLT_VAL-CATEGORY = Alert ID . E.g. Z_BK_BOOK_CANCEL
  
LOOP AT ct_long_text INTO lv_line.

    
IF lv_line CS 'TORONTO'.
      
REPLACE 'TORONTO' IN lv_line WITH 'Toronto'.
      
MODIFY ct_long_text FROM lv_line INDEX sy-tabix.
      
EXIT.     ENDIF.

  
ENDLOOP.


And the result is:

http://1.bp.blogspot.com/-XGt_9xOHOWo/VUPoNcjBycI/AAAAAAAAApQ/COe0hQdzBO4/s1600/alert2.JPG

Labels in this area