I have a Web Dynpro Window which contains view V_MAIN. The V_MAIN in turn has 2 views embedded: V_SEARCH_CRITERIA and V_RESULTS. In V_SEARCH_CRITERIA a user can insert few search criteria (in input fields) and in V_RESULTS there's a TBL_RESULTS with results of the search. Under the TBL_RESULTS with results there's another Table component - TBL_MESSAGES.
I have the following requirement: all messages should be displayed in TBL_MESSAGES. In particular standard messages from domain checks should be rewritten into TBL_MESSAGES. I do not explicitly put MessageArea UI control in any of my views.
My question is: how can I disable standard MessageArea and rewrite the messages to TBL_MESSAGES? In which hook methods should it be done?
I have tried few tricks, which haven't worked.
I get Message Manager and clear messages in WDDOAFTERACTION (I tried it in V_MAIN and in V_SEARCH_CRITERIA)
DATA: l_current_controller TYPE REF TO if_wd_controller, l_message_manager TYPE REF TO if_wd_message_manager. l_current_controller ?= wd_this->wd_get_api( ). CALL METHOD l_current_controller->get_message_manager RECEIVING message_manager = l_message_manager. l_message_manager->clear_messages( ).
I tried to clear MessageArea UI element (the code is invoked in ONACTION method bound to the button BTN_SERARCH in view V_SEARCH_CRITERIA).
data: l_wd_view_controller type ref to if_wd_view_controller, l_api_wdr_msg_area type ref to if_wd_window_controller, l_wd_message_area type ref to if_wd_message_area. l_wd_view_controller ?= wd_this->wd_get_api( ). l_api_wdr_msg_area ?= l_wd_view_controller->get_embedding_window_ctlr( ). l_wd_message_area = l_api_wdr_msg_area->get_message_area( ). l_wd_message_area->reset_messages( i_keep_current = ' ' ).
Unfortunately both attemps haven't succeed.
I would be very grateful for any help.