cancel
Showing results for 
Search instead for 
Did you mean: 

Showing error message in BSP

former_member416498
Active Participant
0 Kudos

Hi folks

Need information on how to show the error/warning messages from a message class on a BSP page. Request you all to help me on this.

bye vijay

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I solved it this way:

<!-- ERROR HANDLING -->
  <% data: message   type string,
           condition type string,
           severity type i,
           count type i.

     count = page->messages->num_messages( ).

     if count gt 0.
       %>
         <htmlb:group id        = "errorgroup"
                      bodyColor = "whitesmoke"
                      width     = "400"
                      title     = "Warning" >
         <htmlb:groupBody>
       <%
       do count times.

         call method page->messages->get_message
            exporting index     = sy-index
            importing condition = condition
            message             = message
            severity            = severity.
          %>
          <htmlb:image src = "warning.gif" />
          <htmlb:textView id        = "text"
                          text      = "<%= message %>"
                          textColor = "CRITICAL" /><br>
          <%




       enddo.
       %>
         </htmlb:group>
         </htmlb:groupBody>
       <%
     endif.
  %>
  <!-- ERROR HANDLING -->

former_member416498
Active Participant
0 Kudos

But Michel how to get the messages from the message class ot the BsP page. Actually that was my question.

former_member416498
Active Participant
0 Kudos

Some how i got the solution with the help of Vijay Babu.

using method of the class cl_bsp_messge has a method, add_message_from_t100. Using this method we can get the message from the message class.