cancel
Showing results for 
Search instead for 
Did you mean: 

Alert Triggering

Former Member
0 Kudos

Hi All,

  I have a requirement, where i need to trigger a mail and display alert in top box of WebClient if a specific conditions is met. I coded for mail triggering part, left with Displaying alerts in alert box. I have searched and found function module 'SALRT_CREATE_API' can be used to create alerts. But i am not very much sure of how and what to pass as input for this function module. I don want to give hyper link for Alerts, just displaying the text will suffice. Any idea/suggestion to trigger a simple alert will be very much helpful

Thanks & Regards

Gokul Ragunathan

Accepted Solutions (1)

Accepted Solutions (1)

former_member188321
Contributor
0 Kudos

1. Do you already have an Alert category defined? Please check in tcode ALRTCATDEF, which alert category you want to use.

(If unclear, A Guide for Alert Configuration in SAP CRM )

2.  Set containter data in code, as similar to :

DATA: lt_container type table of swcont,

                lt_recipient type table of salrtsrcp

.

....

*Fill the Object ID and Description in the container.
call function 'SWC_ELEMENT_SET'
     exporting
       element             = 'OBJECT_ID'
       field               = lv_bp_id
     tables
       container           = lt_container
    exceptions
      type_conflict       = 1
      others              = 2
             .
   if sy-subrc <> 0.
   endif.

...

call function 'SWC_ELEMENT_SET'
     exporting
       element             = 'OBJECT_DESCRIPTION'
       field               = lv_str
     tables
       container           = lt_container
    exceptions
      type_conflict       = 1
      others              = 2
             .
   if sy-subrc <> 0.
   endif.

...

*Fill the list of recipients and Trigger the alert
ls_recipient-uname = sy-uname.
append ls_recipient to lt_recipient.
call function 'SALRT_CREATE_API'
  exporting
    ip_category                  = lv_alert_category "Alery Category to be used
    ip_expiration_date           = sy-datum
    ip_wait_on_commit            = abap_true
  tables
    it_recipients                = lt_recipient
    it_container                 = lt_container
  exceptions
    alert_category_unknown       = 1
    alert_no_recipients          = 2
    alert_error_unknown          = 3
    destination_undefined        = 4
    communication_failure        = 5
    system_failure               = 6
    others                       = 7
           .

I hope this helps.

"

Former Member
0 Kudos

Hi Damandeep,

  thanks for your reply, Actually i dont need hyper link... So i used class 'cl_crm_ic_event' and few lines of code helped me to get Alerts and solved by self

Thanks & Regards

Gokul Ragunathan

Answers (0)