Skip to Content

Run Time error using create_popup_to_confirm in Post_Exit Method

Hi,

I am trying to use the create_popup_to_confirm method to display a popup box in order to create a simple confirmation popup box. The transaction is failing with an exception. Following is the Error analysis from ST22

An exception occurred which is explained in detail below.                       
The exception, which is assigned to class 'CX_WDR_RT_EXCEPTION', was not caught
and therefore caused a runtime error.
The reason for the exception is:
Component ID_0001000300140017 Not Found

Nothing I tried seem to work. I even copied the following code directly from SAP Help in order to try to get the popup box working:

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_cmp_api = wd_this->wd_get_api( ).
l_window_manager = l_cmp_api->get_window_manager( ).
INSERT `Data where changed`   INTO TABLE l_text.        "#EC *
INSERT `Do you want to save?` INTO TABLE l_text.        "#EC *

l_popup = l_window_manager->create_popup_to_confirm(
          text            = l_text
          button_kind     = if_wd_window=>co_buttons_yesnocancel
          message_type    = if_wd_window=>co_msg_type_question
          window_title    = 'Test: Popup to confirm'
          window_position = if_wd_window=>co_center ).

l_popup->open( ).

Now there is one thing that I am wondering that might be causing this, but I don't know for sure. I am executing this code from a Post_Exit method of a method in the COMPONENTCONTROLLER. Since enhancements are in their own container, I don't know if this may be confusing the Web Dynpro App. However the purpose of this enhancement is to show the end user a simple confirmation popup box so that they are informed that they did a particular action. Please let me know if you any ideas. Point will be awarded for helpful answers.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Oct 25, 2008 at 06:43 AM

    hi,

    use following code.

    DATA: lt_text type string_table.

    DATA: mr_popup_window TYPE REF TO if_wd_window.

    • pop a confirmation window for display purpose

    DATA: l_window_manager TYPE REF TO if_wd_window_manager,

    l_cmp_api TYPE REF TO if_wd_component,

    l_window TYPE REF TO if_wd_window.

    l_cmp_api = wd_comp_controller->wd_get_api( ).

    l_window_manager = l_cmp_api->get_window_manager( ).

    append 'DO YOU WANNA SAVE DATA' to lt_text.

    CALL METHOD l_window_manager->create_popup_to_confirm

    EXPORTING

    text = lt_text

    button_kind = if_wd_window=>CO_BUTTONS_YESNO

    CLOSE_BUTTON = ' '

    WINDOW_TITLE = 'POPUP WINDOW'

    WINDOW_WIDTH = '25'

    WINDOW_HEIGHT = '50'

    WINDOW_LEFT_POSITION = 10

    WINDOW_TOP_POSITION = 10

    WINDOW_POSITION = '25'

    RECEIVING

    result = mr_popup_window .

    • associated the action handling methods with the window

    DATA: view_controller TYPE REF TO if_wd_view_controller.

    view_controller = wd_this->wd_get_api( ).

    CALL METHOD mr_popup_window->SET_WINDOW_SIZE

    EXPORTING

    WIDTH = '150'

    HEIGHT = '150'.

    CALL METHOD mr_popup_window->subscribe_to_button_event

    EXPORTING

    button = if_wd_window=>co_button_yes

    action_name = 'ON_DELETE_POPUP_YES'

    action_view = view_controller .

    CALL METHOD mr_popup_window->subscribe_to_button_event

    EXPORTING

    button = if_wd_window=>co_button_no

    action_name = 'ON_DELETE_POPUP_NO'

    action_view = view_controller

    is_default_button = abap_true .

    mr_popup_window->open( ).

    Add comment
    10|10000 characters needed characters exceeded