cancel
Showing results for 
Search instead for 
Did you mean: 

How add one more extra button in popup in webdynpro

Former Member
0 Kudos

Hi Experts,

   Iam displaying a pop up window (invoice_win) from a window(main_win) I am already

maintain one button(SUBMIT) with the below code.Here i need to add one more button(REJECT)

how can we add this button....Anyone could u plz suggest me the suitable solution is grately

appreciated.

DATA lr_window_manager TYPE REF TO if_wd_window_manager.

  DATA lr_api_component  TYPE REF TO if_wd_component.

  DATA lr_window         TYPE REF TO if_wd_window.

  data lr_view_controller TYPE REF TO if_wd_view_controller.

  lr_api_component  = wd_comp_controller->wd_get_api( ).

  lr_window_manager = lr_api_component->get_window_manager( ).

  lr_window         = lr_window_manager->create_window(

                     window_name            = 'INVOICES_WIN'

                     message_display_mode   = if_wd_window=>co_msg_display_mode_selected

                     button_kind            = if_wd_window=>co_buttons_ok

                     message_type           = if_wd_window=>co_msg_type_none

                     default_button         = if_wd_window=>co_button_ok

                     ).

    lr_view_controller = wd_this->wd_get_api( ).

  CALL METHOD lo_window->subscribe_to_button_event   " register event before opening window

    EXPORTING

      button            = if_wd_window=>co_button_ok

      title                 =        'SUBMIT'    

      action_name       = 'OK'   " You have to create action OK in Actions tab & write req handling

      action_view       = lr_view_controller.

  

  lo_window->open( ).

        Thanks in advance...

Regards,

kranthi

Accepted Solutions (0)

Answers (3)

Answers (3)

ramakrishnappa
Active Contributor
0 Kudos

Are you still having this issue open? If not, please close the discussion.

FYI: Its the responsibility of ticket owner to close the discussion, if it is answered, it is very helpful for others in future if they have same requirement.

Message was edited by: Ramakrishnappa Gangappa

ramakrishnappa
Active Contributor
0 Kudos

Hi Kranthi,

You can use buttons if_wd_window=>co_buttons_okcancel.

Please modify your code as below


  lr_window         = lr_window_manager->create_window(

                     window_name            = 'INVOICES_WIN'

                     message_display_mode   = if_wd_window=>co_msg_display_mode_selected

                     button_kind            = if_wd_window=>co_buttons_okcancel

                     message_type           = if_wd_window=>co_msg_type_none

                     default_button         = if_wd_window=>co_button_ok

                     ).

    lr_view_controller = wd_this->wd_get_api( ).

  CALL METHOD lo_window->subscribe_to_button_event   " register event before opening window

    EXPORTING

      button            = if_wd_window=>co_button_ok

      title                 =        'SUBMIT' 

      action_name       = 'OK'   " You have to create action OK in Actions tab & write req handling

      action_view       = lr_view_controller.

"Create another action "REJECT" in your view and subscribe the cancel button to the action

  CALL METHOD lo_window->subscribe_to_button_event 

    EXPORTING

      button            = if_wd_window=>co_button_cancel

      title                 =        'Reject'   

      action_name       = 'REJECT'   "create action "REJECT"

      action_view       = lr_view_controller.

There are different set of buttons available in IF_WD_WINDOW and you can make use of them

Hope this helps you.

Regards,

Rama

ronaldo_aparecido
Contributor
0 Kudos

HI Kranthi

Please Read this discussion.

http://scn.sap.com/thread/1629979