Saturday, March 10, 2012
Steps involved.
  • Create two windows and create view for each window. Embed the views in the corresponding windows. 
  • In the view of  first window, when we click on button, second window should be displayed as popup. 
  • Need to generate code to create popup window for the button OnAction event of the first window. 
Example
  • Create Web Dynpro Component and save it as local object. 
  • When you specify Window and View names when you create Web dynpro component. View START_V would be embedded automatically in the window START_W.  
  •  Go to view START_V -> Layout tab 
  • -->Create one button UI element-->OnAction event for that button

  •  Go to ONACTIONGOTO_POPUP event handler method -> Generate code code for popup window as shown below. 
    METHOD onactiongoto_popup .
      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.
    
      lo_api_component  = wd_comp_controller->wd_get_api( ).
      lo_window_manager = lo_api_component->get_window_manager( ).
      lo_window         = lo_window_manager->create_window(
                         window_name            = 'POPUP_W'
    *                    title                  =
    *                    close_in_any_case      = abap_true
                         message_display_mode   = if_wd_window=>co_msg_display_mode_selected
    *                    close_button           = abap_true
                         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
                         ).
    
      lo_window->open( ).
    
    ENDMETHOD.
    
  • Create one more view POPUP_V
  • Go to view POPUP_V -> Layout tab -> Create TextView UI element and give some text for that. 
  • Create one more Window POPUP_W
  • Embed POPUP_V view in the window POPUP_W as shown.
  • Create Web Dynpro Application and save it as local object. 

  • When you save, System asks Interface view and plug name. We have to give Interface view as START_W and plug DEFAULT. 
  • Run the Web Dynpro Application. 

1 comment:

Your useful comments, suggestions are appreciated.Your comments are moderated.

Followers

Contact Form

Name

Email *

Message *

Web Dynpro ABAP Book

An SAP Consultant

Follow US


Want to Contribute ?

If you are interested in writing about the new stuff you learn everyday while working, please write to the.sap.consultants@gmail.com.

Click on Contribution for more details.