on 03-24-2012 9:59 AM
i have a requirement in which i have to display multiple messages in a view, i know how to display a message in a view using message manager.But, i don't know how to display multiple messages in webdynpro abap.
Hi, I don't understand your issue.
You can display multiple messages in a view using the message manager. Only need to call several times to the corresponding method...
Can you explain your problem with more details ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prabhakar,
Let you wanna display multiple types (error, warning, success) messages, just create your own structure follows:
Types: Begin of ty_messages,
message type string,
message_type type char01,
end of ty_messages.
Data: lt_messages type table of ty_messages,
ls_messages type ty_messages.
Data: lv_error_true(1).
**** Append the messages in your required places.
ls_messages-message_type = 'S'.
ls_messages-message = 'This is success message'.
append ls_messages to lt_messages.
ls_messages-message_type = 'E'.
ls_messages-message = 'This is error message'.
append ls_messages to lt_messages.
ls_messages-message_type = 'W'.
ls_messages-message = 'This is success message'.
append ls_messages to lt_messages.
if lt_messages is not initial.
loop at lt_messages into ls_messages.
if ls_messages-message_type eq 'E'.
lo_message_manager->report_error_message(
message_text = ls_messages-message ).
lv_error_true = 'X'. """" if required to stop the process.
elseif ls_messages-message_type eq 'W'.
lo_message_manager->report_warning(
message_text = ls_messages-message ).
elseif ls_messages-message_type eq 'S'.
lo_message_manager->report_success(
message_text = ls_messages-message ).
endif.
endloop.
if lv_error_true = 'X'.
RETURN.
ENDIF.
endif.
I hope this would resolve your issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Prabhakar,
Create a structure at se11 level like below:
and write the below code in your WDP component:
data: lt_messages type table of ZST_WD_REPORT_ATTR_ERROR_MSG,
ls_messages type ZST_WD_REPORT_ATTR_ERROR_MSG.
ls_messages-attribute_name = 'ATTRIBUTE1'.
ls_messages-element = <lo_element>.
ls_messages-message = 'Display message 1'.
append ls_messages to lt_messages.
ls_messages-attribute_name = 'ATTRIBUTE 2'.
ls_messages-element = <lo_element>.
ls_messages-message = 'Display message 2'.
append ls_messages to lt_messages.
ls_messages-attribute_name = 'ATTRIBUTE 3'.
ls_messages-element = <lo_element>.
ls_messages-message = 'Display message 3'.
append ls_messages to lt_messages.
***** Display messages at a time.
if lt_messages is not initial.
loop at lt_messages into ls_messages.
lo_message_manager->report_attribute_error_message(
attribute_name = ls_messages-attribute_name
element = ls_messages-element
message_text = ls_messages-message ).
clear: ls_messages.
endloop.
return.
endif.
**************** above is the sample for attribute error message, you can use this for all types of messages by pointing respective parameters.
hope this will resolve your problem.
Prabhakar,
Create a structure at se11 level like below:
and write the below code in your WDP component:
data: lt_messages type table of ZST_WD_REPORT_ATTR_ERROR_MSG,
ls_messages type ZST_WD_REPORT_ATTR_ERROR_MSG.
ls_messages-attribute_name = 'ATTRIBUTE1'.
ls_messages-element = <lo_element>.
ls_messages-message = 'Display message 1'.
append ls_messages to lt_messages.
ls_messages-attribute_name = 'ATTRIBUTE 2'.
ls_messages-element = <lo_element>.
ls_messages-message = 'Display message 2'.
append ls_messages to lt_messages.
ls_messages-attribute_name = 'ATTRIBUTE 3'.
ls_messages-element = <lo_element>.
ls_messages-message = 'Display message 3'.
append ls_messages to lt_messages.
***** Display messages at a time.
if lt_messages is not initial.
loop at lt_messages into ls_messages.
lo_message_manager->report_attribute_error_message(
attribute_name = ls_messages-attribute_name
element = ls_messages-element
message_text = ls_messages-message ).
clear: ls_messages.
endloop.
return.
endif.
**************** above is the sample for attribute error message, you can use this for all types of messages by pointing respective parameters.
hope this will resolve your problem.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.