Messages in the WebClient
January 26, 2008I liked the idea of Nigel James to post handy tips for his own future reference. I decided to shamelessly copy him and post some of my own tips here. I will try to post them as I come across them.
So, you can use the code below in a controller class to display messages to the user.
data: lr_msg_service type ref to cl_bsp_wd_message_service,
lv_msg type symsgv.
lr_msg_service = view_manager->get_message_service( ).
lv_msg = '<YOUR_MESSAGE_VARIABLE>'.
CALL METHOD lr_msg_service->add_message
EXPORTING
iv_msg_type = if_genil_message_container=>mt_error
iv_msg_id = '<YOUR_MESSAGE_CLASS>'
iv_msg_v1 = lv_msg
iv_msg_number = '<YOUR_MESSAGE_NO>'
iv_important_info = abap_true.





