cancel
Showing results for 
Search instead for 
Did you mean: 

How to avoid message repeatedly in webdynpro

Former Member
0 Kudos

1.First we select copy icon it will navigate to a popup window.2.In that we enter save buttton it will populate a msg in inintial screen.

3.then if we drag the cursor in the table control.it populating messge again and again.where we want to write the code to clear the msg node.

tell step by step process.otherwise give some sample code.

Accepted Solutions (1)

Accepted Solutions (1)

Lukas_Weigelt
Active Contributor
0 Kudos

Hi,

if you make the message area invisible as Jayanthi suggested, messages won't be shown at all, I don't think this is what you want. You need to find out, where the message manager throws this message. Since you said this happens again every time you drag the cursor in the table control I would take a look at the hook methods, especially WDDOMODIFYVIEW. You need to find out where the message manager throws the messages first.

Cheers, Lukas

Former Member
0 Kudos

Hi ,

U catch my issue correctly.In the popup view i set the attribute.then i am read in the WDDOMODIFYVIEW.If the arrtibute value is not initial i displaying a msg.

I kept the debugger in the modify view.After copy process is done it coming to the main screen.After clicking the table control down button and then it going to modifyview and populating msg again.

where we want to invisible the node.

there will be 2 view one is main and another one is popup view.In that where we want ti invisble the node

Lukas_Weigelt
Active Contributor
0 Kudos

Mhh.. If I were programming this, I wouldn't work with visibility, cause the message is still there, and this would somehow make it "unclean". I like Priyanka's approach but you need some indicator when to clear the messages. I think I would do it like this:

  • Define an attribute in Context for help purposes, wdy_boolean.
  • On execution of the save button, set this attribute = X
  • Within WDDOMODIFYVIEW, where you send the message, make an IF clause around it, checking whether the attribute is = X. In case it is = X, set it blank again (so this part of coding won't be executed again), then keep everything as it is or make an additional REMOVE_MESSAGE or CLEAR_MESSAGES as Priyanka suggested.

This would prevent the message being posted every time, since the Message Manager will only be executed when the help-attribute indicates that something new has just been saved.

Cheers, Lukas

Former Member
0 Kudos

IF lv_request_no2 is not initial.

     lo_api_controller ?= wd_this->wd_get_api( ).

     CALL METHOD lo_api_controller->get_message_manager
       RECEIVING
         message_manager = lo_message_manager.
     lv_lv_req = lv_request_no2.
*   report message
     CALL METHOD lo_message_manager->report_t100_message
       EXPORTING
         msgid = 'ZRF'
         msgno = '011'
         msgty = 'S'
         p1    = lv_lv_req.

   ENDIF.

this is my code in modify view.hw should set blank in modify view..rearrange my code

chengalarayulu
Active Contributor
0 Kudos

Hi Prabhu,

please refer the below. Just add single line which is made bold.

IF lv_request_no2 is not initial.

     lo_api_controller ?= wd_this->wd_get_api( ).

     CALL METHOD lo_api_controller->get_message_manager
       RECEIVING
         message_manager = lo_message_manager.
     lv_lv_req = lv_request_no2.
*   report message
     CALL METHOD lo_message_manager->report_t100_message
       EXPORTING
         msgid = 'ZRF'
         msgno = '011'
         msgty = 'S'
         p1    = lv_lv_req.

lo_message_manager->clear_messages( ).

   ENDIF.

Former Member
0 Kudos

Hi ,

If i give this  in modifyview lo_message_manager->clear_messages( ).  message is not populating for the first time itself.So give another idea to solve the issue.

chengalarayulu
Active Contributor
0 Kudos

Hi Try to change sequence in line of code snippet.

     lo_api_controller ?= wd_this->wd_get_api( ).

     CALL METHOD lo_api_controller->get_message_manager

       RECEIVING

         message_manager = lo_message_manager.

IF lv_request_no2 is not initial.

     lv_lv_req = lv_request_no2.

lo_message_manager->clear_messages( ).

*   report message
     CALL METHOD lo_message_manager->report_t100_message
       EXPORTING
         msgid = 'ZRF'
         msgno = '011'
         msgty = 'S'
         p1    = lv_lv_req.

ELSE.<<<<<<<<<<<< Use this if required >>>>>>>>>>>>>>

lo_message_manager->clear_messages( ).

   ENDIF.

Former Member
0 Kudos

If i clear the lo_message_manager->clear_messages( ). where u should in the before reply it will not populating any message.

chengalarayulu
Active Contributor
0 Kudos

Clear should be condition based, when you condition tru then only make it clear.

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Try this. If you clear lv_request_no2, next time it won't have any values and make sure it is getting populated in the place where it is required.

IF lv_request_no2 is not initial.

     lo_api_controller ?= wd_this->wd_get_api( ).

     CALL METHOD lo_api_controller->get_message_manager
       RECEIVING
         message_manager = lo_message_manager.
     lv_lv_req = lv_request_no2.
*   report message
     CALL METHOD lo_message_manager->report_t100_message
       EXPORTING
         msgid = 'ZRF'
         msgno = '011'
         msgty = 'S'
         p1    = lv_lv_req.
  Clear lv_request_no2.
   ENDIF.

Former Member
0 Kudos

Thanks for all of them.To share ur idea...i clear my issue using the logic below,

IF lv_request_no2 is not initial.

     lo_api_controller ?= wd_this->wd_get_api( ).

     CALL METHOD lo_api_controller->get_message_manager
       RECEIVING
         message_manager = lo_message_manager.

     DATA lo_nd_count TYPE REF TO if_wd_context_node.

     DATA lo_el_count TYPE REF TO if_wd_context_element.
      DATA ls_count TYPE wd_this->element_count.
     DATA lv_count TYPE wd_this->element_count-count.

**     navigate from <CONTEXT> to <COUNT> via lead selection
      lo_nd_count = wd_context->get_child_node( name = wd_this->wdctx_count ).

**     @TODO handle non existant child
**     IF lo_nd_count IS INITIAL.
**     ENDIF.
*
**     get element via lead selection
      lo_el_count = lo_nd_count->get_element( ).

**     @TODO handle not set lead selection
      IF lo_el_count IS INITIAL.
      ENDIF.

          lo_el_count->get_attribute(
           EXPORTING
             name =  `COUNT`
           IMPORTING
             value = lv_count ).

*     @TODO fill attribute
     lv_count = lv_count + 1.

*     set single attribute
       lo_el_count->set_attribute(
         name =  `COUNT`
         value = lv_count ).


     if lv_count > 1.

     lv_lv_req = lv_request_no2.
*lo_message_manager->clear_messages( ).
      lv_request_no2 = ' '.

* set single attribute
   lo_el_copy->set_attribute(
     name =  `REQUEST_NO`
     value = lv_request_no2 ).
   endif.
*   report message
     CALL METHOD lo_message_manager->report_t100_message
       EXPORTING
         msgid = 'ZRF'
         msgno = '011'
         msgty = 'S'
         p1    = lv_lv_req.
*lo_message_manager->clear_messages( ).

   ENDIF.

if lv_count greater than 1 means i am set lv_request_no2 blank.while coming to modifyview again then lv_request_no2 is initial then it wont come to that condition..

Thanks for all of them.........


Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Try using the interface IF_WD_MESSAGE_MANAGER methods:

1) CLEAR_MESSAGES to remove all messages

Or

2) REMOVE_MESSAGE for removing particular message

Hope this helps

Regards,

Priyanka

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

If you Message area in the main view, just try to make it invisible and run.