on 07-21-2010 12:53 PM
Hi All,
I have a portal webdynpro application. In one of the methods I am getting the reference to message manager and am using the method report_attribute_error_message function to display my error on the screen.
lo_api_controller ?= wd_this->wd_get_api( ).
CALL METHOD lo_api_controller->get_message_manager
RECEIVING
message_manager = lo_message_manager.
CALL METHOD lo_message_manager->report_attribute_error_message
EXPORTING
message_text = 'my message'
element = ' my element'
attribute_name = ' my attribute'
RECEIVING
message_id = lv_msgid.
But when I run the application, the messages are being displayed twice. I tried to debug the application by looking at the message manager object, but everything looks good. How can I avoid displaying the same message twice.
Please help me.
Thanks
Aditya
In one of the methods I am getting the reference to message manager...
Which method is that? Is it an event handler method like onaction_name_of_action ? Make sure that this method is not called twice during one cycle.
Also the case might be not clearing the messages before adding new ones
"make sure variables are local not global ones (defined as controller's attributes)
DATA:
lr_wd_api TYPE REF TO if_wd_view_controller,
lr_mess_man TYPE REF TO if_wd_message_manager.
lr_wd_api = wd_this->wd_get_api( ).
lr_mess_man = lr_wd_api->get_message_manager( ).
"clear before adding new one
lr_mess_man->clear_messages( ).
lr_mess_man->report_error_message(
message_text = 'message text' ).
Regards
Marcin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Make sure you are not calling that error method in any other methods. Further define the message as a string and clear the content before calling.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.