Hello Tapas,
I'm not sure I understood your question correctly, but here it comes now, how you can send alert messages using the standard functionality...
Result:
![Hello.jpg]()
Code:
data: lr_alert_srv type ref to cl_crm_ic_abap_alert,
lv_alertobj type ref to cl_crm_ic_alert,
lv_alert_return type ref to cl_crm_ic_alert_return,
lv_alertid type crm_ic_alert_id,
lv_id type string,
lv_jalert type ref to if_crm_ic_jalert_srv,
lv_alert_msg type string,
lv_alert_text type string,
lv_source type crmt_ic_alert_src.
create object lv_alertobj.
lv_alert_text = '<b>Hello Tapas !!!</b>'.
lv_alertobj->set_message( lv_alert_text ).
lv_alertobj->set_tooltip( lv_alert_text ).
lv_alertid = 'zdmsh_test'.
lv_source = cl_crm_ic_active_alerts=>gc_extern.
lv_id = lv_alertid.
lv_alertobj->set_alertid( lv_id ).
create object lv_alert_return.
lv_alert_return->set_timer( '' ).
lv_jalert = cl_crm_ic_services=>get_jalert_srv_instance( ).
lr_alert_srv = lv_jalert->get_alert_service( ).
try.
lr_alert_srv->if_crm_ic_alert_service~send_alert_cancel( alertid = lv_alertid
session_id = '' ).
lv_alert_msg = lr_alert_srv->if_crm_ic_alert_service~compose_message_text(
alertobj = lv_alertobj
alertreturn = lv_alert_return
).
lr_alert_srv->if_crm_ic_alert_service~send_alert_message(
alert_id = lv_alertid
timer = ''
message = lv_alert_msg
session_id = '' ).
catch cx_root.
endtry.
If you need more fancy solution, you can modify ICCMP_HDR_CNTNT/AlertInfo, register your own event listener and trigger your own SAM event as it was already described by Michael in his post: How to configure and adjust the Account Identification view