cancel
Showing results for 
Search instead for 
Did you mean: 

Create new Warning Message in WEB UI

Former Member
0 Kudos

Hello Geeks,

I have one requirement where i have to create our new warning message when any event will occur.

Could anyone please provide steps to create a new warning message in CRM Web UI.

What all methods and events handler objects i need to enhance to achieve my task.

I`m using SAP CRM 6.0 .

Please reply soon.

Regards,

Shobhit

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Alan,

1) Create the Z message class in se91 and add the message into the class with the corresponding message number.

2) Identify the method where event is occuring and put a check on event condition.

3) When teh condition is satisfied, display error message as of type warning by the following code.

DATA : LVAR_MSGSRV TYPE REF TO CL_BSP_WD_MESSAGE_SERVICE.

LVAR_MSGSRV = CL_BSP_WD_MESSAGE_SERVICE=>GET_INSTANCE( ).

IF LVAR_MSGSRV IS BOUND.

LVAR_MSGSRV->add_message( iv_msg_type = 'W' "Warning message

iv_msg_id = 'ZABC ' " Z Message class name

iv_msg_number = '001' " Z message class message number ).

ENDIF.

Hope this helps.

Thanks & Regards

Swapna.

Former Member
0 Kudos

Hi,

You need to define message in se91. Then depending upon your scenario you can call below code to display error/ warning messgae. The place where you want to display warning/ error message depends upon your business requirement. eg if you want to call message when serive order is saved, then you need to enhance eh_onsave of overview page. and if you want to display warning messge if field is not entered then you need to call this code in do_prepare_output(). If you have your own event then you can call this code there as well.


 lv_msg_service_TA  TYPE REF TO cl_bsp_wd_message_service.


lv_msg_service_TA = me->view_manager->get_message_service( ).
          lv_msg_service_TA->add_message(  iv_msg_type   = 'E'
                                        iv_msg_id     = 'ZMSG'
                                        iv_msg_number = '100' ).

Best regards

Pankaj Kumar