cancel
Showing results for 
Search instead for 
Did you mean: 

report messages as popup

former_member199125
Active Contributor
0 Kudos

hi guys,

I am trying to display report messages as popup information instead of displaying mesage in message area. by using below code

CALL METHOD LO_MESSAGE_MANAGER->REPORT_ERROR_MESSAGE

EXPORTING

MESSAGE_TEXT = TEXT5

  • PARAMS =

  • MSG_USER_DATA =

  • IS_PERMANENT = ABAP_FALSE

  • SCOPE_PERMANENT_MSG = CO_MSG_SCOPE_CONTROLLER

  • VIEW =

SHOW_AS_POPUP = 'x'

  • CONTROLLER_PERMANENT_MSG =

  • MSG_INDEX =

  • CANCEL_NAVIGATION =

  • RECEIVING

  • MESSAGE_ID =

.

But am still getting message in message area. any ideas guys?

Regards

Srinivas

Accepted Solutions (0)

Answers (3)

Answers (3)

phanir_mullapudi
Active Participant
0 Kudos

Hi,

You can follow this very very Simple approach.

1) Create a View to be used a popup window e.g V_MESSAGES

2) In your other views, when you are raising error messages, use the below code:

  • report message

CALL METHOD wd_message_manager->report_t100_message

EXPORTING

msgid = 'ZMESG' " your Message class

msgno = 305 " your Message Number

msgty = 'E' " Message Type

view = 'V_MESSAGES'

show_as_popup = abap_true.

Same for any other messages.

Regards,

Phani

Former Member
0 Kudos

SAP has defined some parameters in case the parameter could be used in future, but they haven't realized the parameters now.

I'm afraid the parameter show_as_popup may be one of the future-usable-parameters. (I'm not sure of it)

I think the second solution is more flexible to implement.

And you could also try to enhance the cl_wdr_message_manager to realize the popup code _.

sahai
Contributor
0 Kudos

hi,

to achieve the required you will have to create a view in your code wherein you will have to have the message printed....now to get this message as a pop-up you will have to create a window in your code and den embed the view you created in it....

m sharing the piece of code below check it i guess it wil help you...if you have any futher doubt let me know

DATA: STRING TYPE STRING,
        OBJKY TYPE DRAD-OBJKY,
        DOKNR TYPE DRAD-DOKNR,
        ONE TYPE STRING,
        TWO TYPE STRING.
DATA: LR_POPUP TYPE REF TO IF_WD_WINDOW,
        LR_VIEW_CONTROLLER TYPE REF TO IF_WD_VIEW_CONTROLLER.

  DATA: LR_API_COMP_CONTROLLER TYPE REF TO IF_WD_COMPONENT,
        LR_WINDOW_MANAGER TYPE REF TO IF_WD_WINDOW_MANAGER.


  LR_API_COMP_CONTROLLER = WD_COMP_CONTROLLER->WD_GET_API( ).
  LR_WINDOW_MANAGER = LR_API_COMP_CONTROLLER->GET_WINDOW_MANAGER( ).

  LR_POPUP = LR_WINDOW_MANAGER->CREATE_WINDOW(
  MODAL               = ABAP_TRUE
  WINDOW_NAME         = 'Zwindow'  "Name of the window
  CLOSE_BUTTON        = ABAP_TRUE
  BUTTON_KIND         = IF_WD_WINDOW=>CO_BUTTONS_OKCANCEL
  CLOSE_IN_ANY_CASE   = ABAP_TRUE
  ).


LR_VIEW_CONTROLLER = WD_THIS->WD_GET_API( ).
  LR_POPUP->OPEN( ).

former_member199125
Active Contributor
0 Kudos

Shashi,

it will completely new pop up scenario, I think we can display report_message as pop up without creating popup window.

Because there is a parameter called SHOW_AS_POPUP.

I am just unable to figure it in my code. And i am not interested in creating separate window and screen for simple message, it will degrade performance na...

Regards

Srinivas

sahai
Contributor
0 Kudos

HI,

IN web dynpro you will always need a window whenever you wil be in need of pop ups....so follow the above suggestion of mine.....

thanks and regards,

sahai.s

Former Member
0 Kudos

Hi,

you do not need to create a specific view or window for pop-up messages.

One way to do it is listed below:

  • Show popup to display error message or get confirmation from user

data: l_cmp_api type ref to if_wd_component,

l_window_manager type ref to if_wd_window_manager,

l_text type string_table,

l_api_main type ref to if_wd_view_controller.

l_api_main = wd_this->wd_get_api( ).

l_cmp_api = wd_comp_controller->wd_get_api( ).

l_window_manager = l_cmp_api->get_window_manager( ).

insert `Error message line 1' into table l_text. "#EC *

insert `Error message line 2` into table l_text. "#EC *

insert `Error message line 3` into table l_text. "#EC *

wd_this->popup = l_window_manager->create_popup_to_confirm(

text = l_text

button_kind = if_wd_window=>co_buttons_yesnocancel "Configure according to your needs...

message_type = if_wd_window=>co_msg_type_question "Whatever type you need...

window_title = 'Title'

window_position = if_wd_window=>co_center ). "#EC *

wd_this->popup->set_remove_on_close( abap_true ).

wd_this->popup->subscribe_to_button_event(

button = if_wd_window=>co_button_yes

action_name = 'ACTION_YES' "You will have to code actions for these...

action_view = l_api_main

is_default_button = abap_true ).

wd_this->popup->subscribe_to_button_event(

button = if_wd_window=>co_button_no

action_name = 'ACTION_NO'

action_view = l_api_main

is_default_button = abap_false ).

wd_this->popup->subscribe_to_button_event(

button = if_wd_window=>co_button_cancel

action_name = 'ACTION_CANCEL'

action_view = l_api_main

is_default_button = abap_false ).

wd_this->popup->open( ).

Regards,

Trond

Edited by: Trond Stroemme on Jul 10, 2011 11:10 AM