Skip to Content

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

Create a structure at se11 level like below:

structure.JPG

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.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply