Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
chengalarayulu
Active Contributor
1,495

This document guides you how to report multiple different messages at a time.

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 would be very helpful.

Labels in this area