on 06-06-2014 7:10 AM
Hi Experts,
i have done a message print at the top of the application and the set up of the area is as below.
Window INIT method:
METHOD wddoinit .
DATA: l_api_mycomp TYPE REF TO if_wd_window_controller.
DATA: l_wd_message_area TYPE REF TO if_wd_message_area.
l_api_mycomp ?= wd_this->wd_get_api( ).
l_wd_message_area = l_api_mycomp->get_message_area( ).
l_wd_message_area->set_display_attributes( i_for_all_instances = 'X'
i_use_toggle_area = 'X'
i_show_only_current = 'X'
).
ENDMETHOD.
Print method is inside view controller which is called where ever the message needs to be printed.
DATA: lo_controller TYPE REF TO if_wd_controller.
lo_controller ?= wd_this->wd_get_api( ).
CALL METHOD wd_this->lo_message_manager->report_t100_message
EXPORTING
msgid = <lfs_messages>-id
msgno = <lfs_messages>-number
msgty = <lfs_messages>-type
p1 = <lfs_messages>-message_v1
p2 = <lfs_messages>-message_v2
p3 = <lfs_messages>-message_v3
p4 = <lfs_messages>-message_v4
is_permanent = abap_true
VIEW = 'V_DASHBOARD' " View Name
controller_permanent_msg = lo_controller
RECEIVING
message_id = lv_msg.
The problem i am facing:
The message log is duplicated evertime there is a round trip on the page.(no code inside wddomodify method)
please help me with tips
Thanks & Regards,
tashi
Hi Tashi,
Are you getting message duplicated again on subsequent action PRINT button, you have set the messages as parmanent, hence old message remains as it is.
Replace : is_permanent = abap_true
with : is_parmanent = abap_false
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rama,
if i do that , then for every round trip i loose the current message and its available only in log.
i want to retain the message till i do another print method , thats why i have made is_permanent = abap_true.
when a user does any round trip operation like changing view layout .. the current message section is emptied. i want to retain the current message and at the same time dont want any duplicates to be copied to the log.
Thanks & Regards,
Tashi
Hi Tashi,
I got your point
I suggest you to clear messages in PRINT method before reporting any messages. So that it clears all existing messages.
Hope this helps you.
Regards,
Rama
Hi Tashi,
If you still looking for avoiding the reporting of duplicate messages, I would suggest you the below workaround solution... use the method WDDOMODIFYVIEW( ) method
May not be very cleaner in approach.
Sample:
if lv_action_name = 'PRINT_MESSAGES'.
data lt_messages type if_wd_message_manager=>ty_t_messages.
data ls_messages like line of lt_messages.
data ls_messages2 like ls_messages.
data lv_msg type string.
lt_messages = wd_this->lo_message_manager->get_messages( ).
sort lt_messages by err_message.
clear: ls_messages2, lv_msg.
loop at lt_messages into ls_messages.
ls_messages2 = ls_messages.
if lv_msg = ls_messages2-err_message.
wd_this->lo_message_manager->remove_message( msg_id = ls_messages2-msg_id ).
endif.
at new err_message.
lv_msg = ls_messages2-err_message.
endat.
endloop.
Hope this work around approach helps you.
Regards,
Rama
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.