cancel
Showing results for 
Search instead for 
Did you mean: 

show_as_popup of IF_WD_MESSAGE_MANAGER~REPORT_MESSAGE not working

Former Member
0 Kudos

Hi experts,

Can someone tell me as to why show_as_popup is not working.

Below is my code


* get message manager
    LO_API_CONTROLLER ?= WD_THIS->WD_GET_API( ).
    call method LO_API_CONTROLLER->GET_MESSAGE_MANAGER
      receiving
        MESSAGE_MANAGER = LO_MESSAGE_MANAGER.

*     report message
          call method LO_MESSAGE_MANAGER->REPORT_MESSAGE
            exporting
              MESSAGE_TEXT  = LS_RET_MESSAGE-MESSAGE
              MESSAGE_TYPE  = 2
              SHOW_AS_POPUP = ABAP_TRUE
            receiving
              MESSAGE_ID    = L_MSG_ID.

the error message is displayed in its usual place and not as popup.

What is the problem? do i have to pass something else ?

Any clue is highly appreciated.

  • is there any other method(instead of calling a view in diff window) where in i can show error message in popup?

Regards,

Ajay

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

FYI,

The code in step 3 will display your popup screen as an error message with two buttons saying 'YES' and 'NO', these buttons will not perform an action and will simply return the user back to the main window. If this is not what you require below is a list of options which will allow you to change this display to suit your needs (adding different buttons, change message type, add action to buttons):

Options for the BUTTON_KIND parameter(which can be found by double clicking on 'co_buttons_ok' )

CO_BUTTONS_NONE - No Buttons

CO_BUTTONS_ABORTRETRYIGNORE - Buttons for 'Cancel', 'Repeat', 'Ignore'

CO_BUTTONS_OK - Buttons for 'O.K.'

CO_BUTTONS_CLOSE - Buttons for 'Close'

CO_BUTTONS_OKCANCEL - Buttons for 'O.k.', 'Cancel'

CO_BUTTONS_YESNO - Buttons for 'Yes', 'No'

CO_BUTTONS_YESNOCANCEL - Buttons for 'Yes', 'No', 'Close'

CO_BUTTON_ABORT - Button for 'Cancel'

CO_BUTTON_RETRY - Button for 'Repeat'

CO_BUTTON_IGNORE - Button for 'Ignore'

CO_BUTTON_OK - Button for 'Ok.'

CO_BUTTON_CLOSE - Button for 'Close'

CO_BUTTON_CANCEL - Button for 'Cancel'

CO_BUTTON_YES - Button for 'Yes'

CO_BUTTON_NO - Button for 'No'

Options for the MESSAGE_TYPE parameter (which can be found by double clicking on 'co_msg_type_error' )

CO_MSG_TYPE_NONE - No message type

CO_MSG_TYPE_WARNING - Warning

CO_MSG_TYPE_INFORMATION - Information

CO_MSG_TYPE_QUESTION - Question

CO_MSG_TYPE_ERROR - Error

CO_MSG_TYPE_STOPP - Cancel

I hope it wud help u

rgds,

amit

Former Member
0 Kudos

Hi Amit,

Thanks for your reply.

I know raising the popup using a separate window.

What i wanted to know is the parameter show_as_popup of REPORT_MESSAGE method is not working?

I don't want to call a different window and view to display error messages?

can't i show the error message as popup usingthe message manager?

regards,

Ajay

Former Member
0 Kudos

Hi Amit,

Thanks for your reply.

I know raising the popup using a separate window.

What i wanted to know is the parameter show_as_popup of REPORT_MESSAGE method is not working?

I don't want to call a different window and view to display error messages?

can't i show the error message as popup usingthe message manager?

regards,

Ajay

Former Member
0 Kudos

try to use REPORT_T100_MESSAGE


*   get message manager
  DATA lo_api_controller     TYPE REF TO if_wd_controller.
  DATA lo_message_manager    TYPE REF TO if_wd_message_manager.
  lo_api_controller ?= wd_this->wd_get_api( ).
  lo_message_manager = lo_api_controller->get_message_manager( ).
*   report message
  lo_message_manager->report_t100_message(
      msgid                     = msgid
      msgno                     = msgno
      msgty                     = msgty
*      p1                        = p1
*      p2                        = p2
*      p3                        = p3
*      p4                        = p4
*      msg_user_data             = msg_user_data
*      is_permanent              = ABAP_FALSE
*      scope_permanent_msg       = CO_MSG_SCOPE_CONTROLLER
*      view                      = view
      *show_as_popup             = show_as_popup*
*      controller_permanent_msg  = controller_permanent_msg
*      msg_index                 = msg_index
*      cancel_navigation         = cancel_navigation
*      enable_message_navigation = enable_message_navigation
*      component                 = component
         ).

Former Member
0 Kudos

Hi Amit,

My error messages are not based on T100 messages.

So i can't use report_t100_message method.

Thanks,

Ajay

Former Member
0 Kudos

Hi,

I guess this is not possible..

Regards,

Lekha.

Edited by: Lekha on Oct 5, 2009 12:55 PM

Former Member
0 Kudos

Hi,

->create another window.

->Now give the name of view embedded in this window in the report _ message.

Refer this code :

*DATA lo_window_manager TYPE REF TO if_wd_window_manager.

*DATA lo_api_component TYPE REF TO if_wd_component.

*DATA lo_window TYPE REF TO if_wd_window.

*

*lo_api_component = wd_comp_controller->wd_get_api( ).

*lo_window_manager = lo_api_component->get_window_manager( ).

*lo_window = lo_window_manager->create_window(

  • window_name = 'WIN2'

  • message_display_mode = if_wd_window=>co_msg_display_mode_selected

    • close_button = abap_true

  • button_kind = if_wd_window=>co_buttons_none

  • message_type = if_wd_window=>co_msg_type_none

  • default_button = if_wd_window=>co_button_ok

  • ).

*lo_window->open( ).

  • get message manager

DATA lo_api_controller TYPE REF TO if_wd_controller.

DATA lo_message_manager TYPE REF TO if_wd_message_manager.

lo_api_controller ?= wd_this->wd_get_api( ).

CALL METHOD lo_api_controller->get_message_manager

RECEIVING

message_manager = lo_message_manager

.

  • report message

CALL METHOD lo_message_manager->report_message

EXPORTING

message_text = 'yahoo'

message_type = '01'

  • params =

  • msg_user_data =

is_permanent = ABAP_FALSE

  • scope_permanent_msg = CO_MSG_SCOPE_CONTROLLER

view = 'VIEW2'

show_as_popup = abap_TRUE

  • controller_permanent_msg =

  • msg_index = -1

cancel_navigation = abap_TRUE

enable_message_navigation = ABAP_TRUE

.

Win2 is new Window.

View2 is new View. Embed an message area in View2.

I hope it helps.

Former Member
0 Kudos

Hi,

I guess this is not possible.. When you check the wdr_test_msg_area then you can know the test cases.

Still Try to do this,

Create 2views with button (Popup) and other with Message area.

Create a window.

In the button handler, call this window as popup with 2nd view. But at this time you need to set the default view as 2nd one.

when the appl is run for 1st time then set the default view as 1st one.

Regards,

Lekha.

Former Member
0 Kudos

Hi Lekha,

Thanks, i understood that using REPORT_MESSASE we can't report a message in popup.

Hi Amit,saurav,

Thanks for your inputs.

I am closing this thread. Thanks all for your valuable inputs.

Regards,

Ajay

Former Member
0 Kudos

Hi Ajay,

This is possible. But u have to create a new window and view not anything else. For creating a pop up message u must have one more window which will open as a pop up.

U will write ur whole code at the same place where u was writing previously.

Create one window say ( WIN2 ) and one view say (VIEW2 ). Now embed this view in window( WIN1 ). Take one message area in the view.

Now use the following code . Write the code at the same place where u was writing previously.

DATA lo_window_manager TYPE REF TO if_wd_window_manager.

DATA lo_api_component TYPE REF TO if_wd_component.

DATA lo_window TYPE REF TO if_wd_window.

lo_api_component = wd_comp_controller->wd_get_api( ).

lo_window_manager = lo_api_component->get_window_manager( ).

lo_window = lo_window_manager->create_window(

window_name = 'WIN2'

message_display_mode = if_wd_window=>co_msg_display_mode_selected

  • close_button = abap_true

button_kind = if_wd_window=>co_buttons_none

message_type = if_wd_window=>co_msg_type_none

default_button = if_wd_window=>co_button_ok

).

lo_window->open( ).

  • get message manager

DATA lo_api_controller TYPE REF TO if_wd_controller.

DATA lo_message_manager TYPE REF TO if_wd_message_manager.

lo_api_controller ?= wd_this->wd_get_api( ).

CALL METHOD lo_api_controller->get_message_manager

RECEIVING

message_manager = lo_message_manager

.

  • report message

call method LO_MESSAGE_MANAGER->REPORT_MESSAGE

exporting

MESSAGE_TEXT = LS_RET_MESSAGE-MESSAGE

MESSAGE_TYPE = 2

SHOW_AS_POPUP = ABAP_TRUE

receiving

MESSAGE_ID = L_MSG_ID.

try it its working fine..

Regards,

Pankaj Aggarwal

Former Member
0 Kudos

Hi Pankaj,

So its inevitable to create a diff window for popup, right!

well i tried as suggested by you, but the error message is being displayed in both the places i.e in the popup as well as in the view that is calling the popup window.

Am i doing some thing wrong?

any clue is helpful.

regards,

Ajay

Former Member
0 Kudos

hey i just forgot to tell u...

U have to provide one more Export parameter for Report message.

view                      = 'VIEW2'

Message will come only to the pop up view.

I have used this code.

Regards,

Pankaj Aggarwal

Former Member
0 Kudos

Hi Pankaj,

Thanks for your inputs.

Regards,

Ajay

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Fill the parameter View of Report_message.

It will work.

Former Member
0 Kudos

Hi Saurav,

Still the same.


    call method LO_MESSAGE_MANAGER->REPORT_MESSAGE
      exporting
        MESSAGE_TEXT  = L_MSG_TEXT
        MESSAGE_TYPE  = 2
        SHOW_AS_POPUP = ABAP_TRUE
        VIEW          = 'V_LIST'
      receiving
        MESSAGE_ID    = L_MSG_ID.

regards,

Ajay

Former Member
0 Kudos

hi Ajay ,

proceed as follow :

1 Within your created web dynpro application create a new view

Create a new web dynpro view which contains the text and UI elements you want to display .

2 Create a new WINDOW (WND_POPUP) to embed the view into it .

3 Insert the following piececode into the appropriate place. i.e. in the wdp action method of your desired button


 Data: context_node type ref to if_wd_context_node.

  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         = 'WND_POPUP'  "Name of the window created in step 2
  TITLE               = 'Please enter all information'
  CLOSE_BUTTON        = ABAP_TRUE
  BUTTON_KIND         = if_wd_window=>CO_BUTTONS_YESNO
  MESSAGE_TYPE        = if_wd_window=>co_msg_type_error
  CLOSE_IN_ANY_CASE   = ABAP_TRUE
*MESSAGE_DISPLAY_MODE = MESSAGE_DISPLAY_MODE
  ).

* Adds an action to the popup screen buttons
* lr_view_controller = wd_this->wd_get_api( ).

* lr_popup->subscribe_to_button_event(
* button = if_wd_window=>co_button_ok
* button_text = 'Yes'
* action_name = 'SUBMIT'
* action_view = lr_view_controller ).

  lr_popup->open( ).

rgds,

amit