cancel
Showing results for 
Search instead for 
Did you mean: 

Message in popup window

Former Member
0 Kudos

Hello experts!

I have a problem with showing messages in a popup. I build two views embedded in one window.

The first view is my main view and the second view is shown as a popup window.

I open the popup with

lr_window = lr_window_manager->create_window(

window_name = 'W_POPUP_BPKIND'

title = 'test'

button_kind = '3'

close_in_any_case = abap_false

message_display_mode = if_wd_window=>co_msg_display_mode_selected

close_button = abap_true

).

On my popup window i have some mandatory fields. One of this mandatory fields is a date field.

If i enter a wrong date for example 99.11.1999 and press my okay button, the error message of the wrong date

appears in my main view in the message area, but i need the message in my popup window.

How is it possible to show the message in the popup window and not in the main view?

Do you have any ideas?

Thanks and best regards!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Huetze,

in the main view 'action' check if the entered date is correct or not.if the date is worng write the following code in the else part to get the popup..

data: l_cmp_api type ref to if_wd_component,

l_window_manager type ref to if_wd_window_manager,

l_popup type ref to if_wd_window,

l_text type string_table,

l_api type ref to if_wd_view_controller,

message type string.

l_cmp_api = wd_comp_controller->wd_get_api( ).

l_window_manager = l_cmp_api->get_window_manager( ).

concatenate 'The following date dosent exits' <date> into text separated by ' '.

append text to l_text.

l_popup = l_window_manager->create_popup_to_confirm(

text = l_text

button_kind = if_wd_window=>co_buttons_ok

message_type = if_wd_window=>co_msg_type_information

window_title = 'Information'

window_position = if_wd_window=>co_center ).

l_popup->open( ).

No need to create second view for popup.it will work.try this and let me know if its working.

Thanks,

anusha.

Former Member
0 Kudos

Hi Anusha!

Thanks for your help! It works great.

Regards!

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi pass the pop up name in the VIEW parameter of the message manager report_t100_message.

THANKS

arjun_thakur
Active Contributor
0 Kudos

Hi,

To restrict the error message to pop up view only, just pass the pop up view name while calling the message manager. Refer the following code


CALL METHOD lo_message_manager->report_t100_message
      EXPORTING
        msgid = 'ZMSG'
        msgno = '108'
        msgty = 'E'
        view = 'ZPOPUP_ERROR'. "pass the pop view name here

Also refer this thread: https://forums.sdn.sap.com/click.jspa?searchID=25780873&messageID=6324112

I hope it helps.

Regards

Arjun

Former Member
0 Kudos

Hi,

have you tired using a MessageArea in the PopUp View?

http://help.sap.com/saphelp_nw04s/helpdata/en/04/b08841349e1909e10000000a155106/frameset.htm

if you insert that UI Element it should work, but I'm not sure right now.

I think you would need to destroy the pop up after you closed the window, to make sure your messages will be displayed again. Otherwise they might be shown in the closed pop up in the back ground...

kind regards

Stefan

Former Member
0 Kudos

Try embed your pop up view in a separate window.

Regards,

Abdul.