cancel
Showing results for 
Search instead for 
Did you mean: 

Messages into Message Area

selvakumar_mohan
Active Participant
0 Kudos

Hi All,

I have a message log for my application. i am populating the messages with the following code.

case ls_message-TYPE.
when 'S'.
lv_type = 0.
when 'W'.
lv_type = 1.
when 'E'.
lv_type = 2.
endcase.

CALL METHOD l_message_manager->report_message
  EXPORTING
    message_text              = ls_message-MESSAGE
    message_type              = lv_type
*    params                    =
*    msg_user_data             =
*    is_permanent              = ABAP_FALSE
*    scope_permanent_msg       = CO_MSG_SCOPE_CONTROLLER
*    view                      =
*    show_as_popup             =
*    controller_permanent_msg  =
*    msg_index                 =
*    cancel_navigation         =
*    enable_message_navigation =
*  receiving
*    message_id                =

I have a message area UI in my application. I am getting the messages displayed, but it is not displayed into the message area UI, instead it is populated into the WD framework's message area.

Please help me to understand how do i make the messages come into the message area.

Thanks,

Selvakumar M.

Accepted Solutions (1)

Accepted Solutions (1)

arjun_thakur
Active Contributor
0 Kudos

Hi,

Message area appears only when there is a message to be displayed. You must have placed the messgae area on top of the page. Messages gets displayed in message area, you don't need to do anything for it.

Regards

Arjun

selvakumar_mohan
Active Participant
0 Kudos

Hi Arjun,

The messages are display even if i remove the message area UI.

The exact requirement is that my message log is very big, so the customer is intended to have a text some thing link Show/Hide Message Log, so whenever the messages are available the link has to appear and the user on clicking it only the messages should be shown and if again they click on it they should hidden..

So what i planned was, if i put the messages into the message area, i can change the visibility of the message area, by linking it's visibility to an attribute and toggle the attribute to yes or no on clicking a link to action UI.

Please help me achieving this.

Thanks,

Selvakumar M.

uday_gubbala2
Active Contributor
0 Kudos

Hi Selva,

Its not possible to control the visibility of the MessageArea by binding to any context attributes. You can either embed the MessageArea within a Tray and have the Tray in an collapsed (i.e, expanded property set to false) state by default.

Regards,

Uday

uday_gubbala2
Active Contributor
0 Kudos

And you were saying that the reason why you wanted to hide this MessageArea coz ots taking up lot of space on your screen. You can try proceed in the manner below to restrict the size occupied by the MessageArea irrespective of the number of entries it might contain.

1) Create a TransparentContainer at the area where you want your messages to be displayed.

2) Specify fixed width & height for this TransparentContainer.

3) Now embed the MessageArea ui element inside this TransparentContainer so it would also inherit the same properties as the TransparentContainer.

4) Set the scrollingMode property of the TransparentContainer to "Auto" so that you will have the scrollbars appear within the container depending up on the number of messages that are getting displayed. (NOTE: If you ommit setting this property you will find no difference & all the messages would get displayed like how they were getting earlier & eat up your screen space.)

Now if the number of messages increases the TransparentContainer would get a scrollbar & they would get displayed within the fixed area specified by you. You wouldn't be having the problem of them eating up too much of your screen space.

Regards,

Uday

selvakumar_mohan
Active Participant
0 Kudos

Hi Uday,

You suggestion for tray has helped me oout.

Thanks alot.

Selvakumar M,.

Answers (2)

Answers (2)

former_member40425
Contributor
0 Kudos

Hi Selva,

You can do some work around.

Insert two linktoaction UI elements(One having name as Show Messages and second as Hide Messages ) and one messagearea UI element in your view.

Now create one context attribute Visible of type WDUI_VISIBILITY and bind the visible propery of both linktoaction UIs with this attribute. Keep the default value of this attribute as 01 .

Check Your message if it is not empty then show both the elements by setting this attribute as 02.

DATA ls_err TYPE symsg.

   if ls_err is not initial.
*      set single attribute
       lo_el_context->set_attribute(
         name =  `VISIBLE`
         value = '02' ).

     endif.

Now in the onaction of linktoaction UI elements control the visibilty of your messagearea. For that also you need to create one more context attribute of type wdui_visibility and need to bind it with your messagearea UI element.

P.S. : You can use Buttons also in place of linktoaction UI elements.

I hope it helps.

Regards,

Rohit

Former Member
0 Kudos

Hi Selva,

If we palce message area in the layout automatically our message will be displayed inthe area, no need to do any thing.

For further clarification on Error messages refer the below thread: