cancel
Showing results for 
Search instead for 
Did you mean: 

Disabling validation messages in MessageArea and rewriting to custom Table

Former Member
0 Kudos

Dear Experts,

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.

1)

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( ).

2)

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.

Best regards,

Adam Sas

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Unfortunately this solution doesn't work.

I have created MessageArea MSA_MESSAGES in view V_MAIN on the bottom of the page.

When I bound MSA_MESSAGES-VISIBLE property to the context, the framework automatically displays standard MessageArea on top of the page (although I put my MSA_MESSAGES on the bottom).

The same scenario happens when I do not bind MSA_MESSAGES-VISIBLE to the context, but I put the following code in the wddomodifyview:


  DATA: l_rcl_ui_message_area TYPE REF TO cl_wd_message_area.
  DATA: lv_visibility         TYPE wdui_visibility.

  lv_visibility = '01'.
  l_rcl_ui_message_area ?= view->get_element( id = 'MSA_MESSAGES' ).

  l_rcl_ui_message_area->set_visible( lv_visibility ).

Regards,

Adam Sas

Former Member
0 Kudos

Hi,

For now you haven't created any message area, can you try creating one Message Area, and bind its visiblity property to an attribute of type wdy_boolean.

And in wddomodifyview view you can set this attribute to false.

In this way I guess that all the messages will be placed inside this message area and you can then hide them, instead of trying to delete\ clear them.

Then you can get all the messages using method get_messages of if_wd_message_manager and put into your table.

try this out.

Regards

Manas Dua