cancel
Showing results for 
Search instead for 
Did you mean: 

urgent : Runtime error in create_popup_to_confirm

Former Member
0 Kudos

I get the below runtime error.

+View V_ANALYSIS_DETAILS has no action BUTN_REJECT x«Â +

and this is my code. can someone suggest me what am i missing in it

l_api_main = wd_this->wd_get_api( ).

l_cmp_api = wd_comp_controller->wd_get_api( ).

str = 'Approved'.

APPEND str TO str_table.

str = 'Reason Rate Transferred set on activity'.

APPEND str TO str_table.

l_window_manager = l_cmp_api->get_window_manager( ).

l_popup = l_window_manager->create_popup_to_confirm(

text = str_table

button_kind = if_wd_window=>co_buttons_ok "4

message_type = 1

close_button = 'X'

window_title = 'Status Confirmation'

window_position = if_wd_window=>co_center ).

l_popup->subscribe_to_button_event(

button = if_wd_window=>co_button_yes

action_name = 'BUTN_REJECT'

action_view = l_api_main

is_default_button = abap_true ).

l_popup->open( ).

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member515618
Active Participant
0 Kudos

Hi Suri,

Firstly we have to pass the action name and not the button name to action_name at the time of subscribing the action.

By default, the popup for confirmation will get closed upon any action performed.

Check the code in the action assigned 'Ok' button. there might be a case where the code for calling the popup is triggered again.

Please find the below code snippet for creating a Pop up for confirmation.

*data declaration

data:

l_componentcontroller_api TYPE REF TO if_wd_component,

l_window_manager TYPE REF TO if_wd_window_manager,

l_window TYPE REF TO if_wd_window,

lt_text TYPE string_table,

l_text_line TYPE string,

l_api TYPE REF TO if_wd_view_controller,

l_api = wd_this->wd_get_api( ).

l_text_line = cl_bsp_runtime=>if_bsp_runtime~get_otr_text( alias = '/RIO/ZHSE/025' ).

APPEND l_text_line TO lt_text.

l_componentcontroller_api = wd_comp_controller->wd_get_api( ).

l_window_manager = l_componentcontroller_api->get_window_manager( ).

CALL METHOD l_window_manager->create_popup_to_confirm

EXPORTING

text = lt_text

button_kind = if_wd_window=>co_buttons_yesnocancel

message_type = if_wd_window=>co_msg_type_question

  • CLOSE_BUTTON = ABAP_TRUE

  • WINDOW_TITLE =

  • WINDOW_LEFT_POSITION =

  • WINDOW_TOP_POSITION =

window_position = if_wd_window=>co_center

  • WINDOW_WIDTH =

  • WINDOW_HEIGHT =

RECEIVING

result = l_window.

CALL METHOD l_window->subscribe_to_button_event

EXPORTING

button = if_wd_window=>co_button_yes

  • BUTTON_TEXT =

  • TOOLTIP =

action_name = 'BACK_AND_SAVE'

action_view = l_api

is_default_button = abap_true.

CALL METHOD l_window->subscribe_to_button_event

EXPORTING

button = if_wd_window=>co_button_no

  • BUTTON_TEXT =

  • TOOLTIP =

action_name = 'BACK_AND_NO_SAVE'

action_view = l_api

is_default_button = abap_false.

l_window->open( ).

endif.

Former Member
0 Kudos

i got the issue i get the popup now. but the thing with pop-up is when u press YES on the pop-up the pop-up comes back again and when i press NO the pop-up goes away. can someone tell me why the pop-up is behaving this way. coz i need the pop-up to go away when i press YES

Former Member
0 Kudos

Hi Suri,

In the action handler for action TO_REJECT_TRANSFER, you need to have a call to 'close()' the window.

Regards,

Neha

<i><b>PS: Reward if helpful</b></i>

Former Member
0 Kudos

FYI

My Button Id is BUTN_REJECT and it action name is TO_REJECT_TRANSFER