cancel
Showing results for 
Search instead for 
Did you mean: 

error in delete confirmation pop up message

Former Member
0 Kudos

Hi All,

I need to adda pop up to confirm the deletetion and for this I have done the following:

1. I have a button in my main view "Delete".

2. On action of Delete I have got the following code in place:

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.
  data lo_view_controller type ref to if_wd_view_controller.
  data :  lt_text TYPE string_table,
          ls_text TYPE string.

  ls_text = 'You want to delete ..Are you sure?'.
  INSERT ls_text INTO TABLE lt_text.

* Get Window manager
  lo_api_component  = wd_comp_controller->wd_get_api( ).
  lo_window_manager = lo_api_component->get_window_manager( ).

  lo_window = lo_window_manager->create_popup_to_confirm( text = lt_text
  button_kind     = if_wd_window=>co_buttons_yesno
  message_type    = if_wd_window=>CO_MSG_TYPE_WARNING
  window_title    = 'Information to Confirm...'
  window_position = if_wd_window=>co_center ).

  lo_view_controller = wd_this->wd_get_api( ).

* creating ok button
  lo_window->subscribe_to_button_event(
             button = if_wd_window=>co_button_yes
             action_name = 'YES'
             action_view = lo_view_controller
             is_default_button = abap_false ).

  lo_window->subscribe_to_button_event(
             button = if_wd_window=>co_button_no
             action_name = 'NO'
             action_view = lo_view_controller
             is_default_button = abap_true ).

* Set the height and width here
  lo_window->set_window_size( width = '40%' height = '5%' ).

  lo_window->open( ).

3. I created a view v_delete and created two actions within that view YES and NO and I have also created a window W_delete and embedded the window to the view v_delete.

4. Within the view v_delete I created two actions one each for YES and NO.

and now when I run the application I am getting the following short dump:

Action &OBJECT_ID& does not exist

can you please tell me what am I doing wrong here.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Raja,

You are displaying popup to confirm window, why you create another view( v_delete ). just create YES and No buttons

in main view itself. it will work.

Cheers,

Kris.

Former Member
0 Kudos

Thanks for the reply, so if I got u ryt what I née to do is the following:

Put the code in on action of the delete button and then create two actions in the main view for yes and now and then embedd the view to the window w_window... Is that ryt?

Former Member
0 Kudos

thanks Kris it worked.... the short dump that I was getting was because I forgot to create the action for NO button

Former Member
0 Kudos

Hi,

Yes write above code in on_action of delete button.

And create two actions YES and NO.. if you want any actions to do on click of YES or NO write your code. Otherwise leave it.

Cheers,

Kris.

Answers (0)