cancel
Showing results for 
Search instead for 
Did you mean: 

Error when registering events to popup button

Former Member
0 Kudos

I encountered an error when try to register events to popup button:

-


The following error text was processed in the system SMF : The dafault button could not be set, as it has not been specified as a popup button

The error occurred on the application server uscismf_SMF_10 and in the work process 0 .

The termination type was: RABAX_STATE

-


OR

-


No Button 4 Is Defined for Popup WIN_POP_CSI

-


What step I missed for the correct setup?

Is any one who can help me?

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello, I changed open to the last according to your suggestion,

but it still doesn't work:

Code:

-


method OPEN_POPUP_EVENT .

data:lr_api_comp_controller type ref to if_wd_component,

lr_window_manager type ref to if_wd_window_manager,

ok_text TYPE string.

lr_api_comp_controller = wd_this->wd_get_api( ).

lr_window_manager = lr_api_comp_controller->get_window_manager( ).

e_popup = lr_window_manager->create_window(

  • MODAL = ABAP_TRUE

window_name = i_popup_name

title = i_title

  • CLOSE_BUTTON = ABAP_TRUE

button_kind = if_wd_window=>co_button_ok

message_type = if_wd_window=>co_msg_type_information

  • CLOSE_IN_ANY_CASE = ABAP_TRUE

  • MESSAGE_DISPLAY_MODE = MESSAGE_DISPLAY_MODE

).

e_popup->set_window_position( left = 500 top = 500 ).

e_popup->set_button_kind( if_wd_window=>co_button_ok ).

ok_text = 'Assign'.

if ( e_popup is bound ).

e_popup->subscribe_to_button_event(

button = if_wd_window=>co_button_ok

button_text = OK_TEXT

action_name = I_EVENTN

action_view = I_VIEW_CTR

is_default_button = abap_true ).

endif.

e_popup->open( ).

wd_this->w_pop = e_popup.

endmethod.

-


Former Member
0 Kudos

Hi Peter,

Can you try the following:

data:lr_api_comp_controller type ref to if_wd_component,

lr_window_manager type ref to if_wd_window_manager,

ok_text TYPE string,

e_popup type ref to if_wd_window,

lr_view_controller type ref to if_wd_view_controller.

lr_api_comp_controller = wd_comp_controller->wd_get_api( ).

lr_window_manager = lr_api_comp_controller->get_window_manager( ).

ok_text = 'Assign'.

e_popup = lr_window_manager->create_popup_to_confirm(

text = <message table>

button_kind = if_wd_window=>co_button_ok

message_type = if_wd_window=>co_msg_type_success

window_title = ok_text

window_position = if_wd_window=>co_center

).

if ( e_popup is bound ).

lr_view_controller = wd_this->wd_get_api( ).

e_popup->subscribe_to_button_event(

button = if_wd_window=>co_button_ok

button_text = OK_TEXT

action_name = 'OK'

action_view = lr_view_controller

is_default_button = abap_true ).

endif.

e_popup->open( ).

Try if this works. I have done like this and it has worked.

Regards,

Nithya

mohammed_anzys
Contributor
0 Kudos

Hello,

Nithya is running this code in the view , where as you have put the code in the componet cotroller .So make the necessary changes for your code to work

Thanks

Anzy

Former Member
0 Kudos

Solve, I made a small mistake that results in big, see code in bold

wd_comp_controller->open_popup(

EXPORTING

i_title = 'Check Step Pool Insert'

i_popup_name = 'WIN_POP_CSI'

<b> i_button_kind = if_wd_window=>co_buttons_ok</b>

i_message_type = if_wd_window=>co_msg_type_none

IMPORTING e_popup = e_popup ).

if ( e_popup is bound ).

e_popup->subscribe_to_button_event(

<b>button = if_wd_window=>co_button_ok</b>

button_text = 'OK'

action_name = 'ADDCS'

action_view = lr_view_controller

is_default_button = abap_true ).

mohammed_anzys
Contributor
0 Kudos

Hi

Yeah true..Button kind needs to be mentioned.....

Tahnk

Anzy

Yashpal
Active Contributor
0 Kudos

Hi,

I think u have given the name of a button as default which is not present like

in ur window u have specified buttons ( yes and no ) and in default u have setted 'CANCEL' button , paste the code which u r using.

Regards

Yashpal

Former Member
0 Kudos

Hi, Code which caused the exception:

data:lr_api_comp_controller type ref to if_wd_component,

lr_window_manager type ref to if_wd_window_manager,

ok_text TYPE string.

lr_api_comp_controller = wd_this->wd_get_api( ).

lr_window_manager = lr_api_comp_controller->get_window_manager( ).

e_popup = lr_window_manager->create_window(

  • MODAL = ABAP_TRUE

window_name = i_popup_name

title = i_title

  • CLOSE_BUTTON = ABAP_TRUE

button_kind = if_wd_window=>co_button_ok

message_type = i_message_type

  • CLOSE_IN_ANY_CASE = ABAP_TRUE

  • MESSAGE_DISPLAY_MODE = MESSAGE_DISPLAY_MODE

).

e_popup->set_window_position( left = 500 top = 500 ).

e_popup->open( ).

e_popup->set_button_kind( if_wd_window=>co_button_ok ).

e_popup->set_default_button( if_wd_window=>co_button_ok ).

ok_text = 'Assign'.

if ( e_popup is bound ).

e_popup->subscribe_to_button_event(

button = if_wd_window=>co_button_ok

button_text = OK_TEXT

action_name = I_EVENTN

action_view = I_VIEW_CTR

is_default_button = abap_true ).

endif.

wd_this->w_pop = e_popup.

Yashpal
Active Contributor
0 Kudos

Hi,

U have written the code e_popup->open( ). in the middle which has to written at the last .

First create the window which u have done ,

set the properties like defalut button , button kind , size

then if want to handle the event bye the buttons in window subscribe it ,

then open the window .

so its the last step which u have done in middle and its causing the problem

Regards

Yashpal

Former Member
0 Kudos

The set_button_kind, set_default_button are all not required. And window->open( ) should be called after subscribe to button event. That should be at the end. Check if it works now.

mohammed_anzys
Contributor
0 Kudos

Set_button_kind is required but the other one is not required..Like Nithya has pointed out...you should call the OPEN method only in the last........And make sure that , you mention the action name and mot the method name..

Message was edited by:

Mohammed Anzy S