cancel
Showing results for 
Search instead for 
Did you mean: 

Webdynpro pop up text change

0 Kudos

Hi All,

I have created a pop up window by using method create_popup_to_confirm of if_wd_window_manager . I have created the OK button by using if_wd_window=>co_button_ok of if_wd_window .

I need to change the default button text " OK " to " EDIT ". I am following the below approach .

view_controller = wd_this->wd_get_api( ).

lo_window->subscribe_to_button_event(

button = if_wd_window=>co_button_ok

button_text = 'EDIT'

action_name = 'MSG'

action_view = view_controller ).

Note : Action " MSG " is a dummy action which I have created just to change the default button text .

This works if the control is in the same view where pop up is called . If we have to go back to other webdynpro component/ view then , after clicking on EDIT button in pop up , it gives the dump with the error " Controller for View, Window, Interface, and Configuration Cannot Be Created " .

Please let me know if there is any other way to change the default text in the pop up screen or any other solution . I am ok to use any other method which creates pop up window and default text should be modified .

Thanks,

Kiran.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Kiran,

If its that important for you to change the button label, I would suggest creating a new view and calling it as a popup.

Please follow below steps to do so:

1) Create a new view with your respective design having message and EDIT button.

2) Create a new window say Popup_Window

3) Add the new view to this window and add below code

4)Create a

Data: context_node type ref to if_wd_context_node.

data: lr_popup type ref to if_wd_window,

lr_view_controller type ref to if_wd_view_controller.

data: lr_api_comp_controller type ref to if_wd_component,

lr_window_manager type ref to if_wd_window_manager.

lr_api_comp_controller = wd_comp_controller->wd_get_api( ).

lr_window_manager = lr_api_comp_controller->get_window_manager( ).

lr_popup = lr_window_manager->create_window(

MODAL = ABAP_TRUE

window_name = 'POPUP_WINDOW' "Name of the window created in step 2

TITLE = Confirmation Message"

CLOSE_BUTTON = ABAP_TRUE

BUTTON_KIND = if_wd_window=>CO_BUTTONS_OKCANCEL

MESSAGE_TYPE = if_wd_window=>co_msg_type_error

CLOSE_IN_ANY_CASE = ABAP_TRUE

*MESSAGE_DISPLAY_MODE = MESSAGE_DISPLAY_MODE

).

  • Adds an action to the popup screen buttons

  • lr_view_controller = wd_this->wd_get_api( ).

  • lr_popup->subscribe_to_button_event(

  • button = if_wd_window=>co_button_ok

  • button_text = 'EDIT'

  • action_name = 'EDIT'

  • action_view = lr_view_controller ).

lr_popup->open( ).

I hope it helps.

Please revert back in case of issues.

Regards,

Sumit