Web Dynpro Close SAP Portal Window

Tuesday, 5 July 2016

This is how you can close a Portal Window from Web Dynpro. There are however some restrictions on when a portal window can be close which you can read at link Restrictions in CLOSE WINDOW Functions
In my example window W_MAIN is loaded on the page with V_MAIN in it. On the press of button ‘Close’ portal windows needs to be closed.

Step 1: Add exit plug in window

In window W_MAIN define an outbound plug with name EXIT of type ‘Exit’. Mark this as Interface plug. Also add an importing parameter CLOSE_WINDOW of type Boolean.

Step 2: Define usage of window in view

Go to view V_MAIN where close button is. On the Properties tab define usage of window W_MAIN.

Step 3: Add method and make call to window’s exit plug

Now add method CLOSE_WINDOW in view V_MAIN. Use Web Dynpro Code Wizard to call exit plug of window W_MAIN.

Pass value abap_true to close_window parameter. Your code should look like this.


1
2
3
4
5
6
7
8
METHOD close_window .
  DATA lo_w_main TYPE REF TO ig_w_main .
  lo_w_main =   wd_this->get_w_main_ctr( ).
  lo_w_main->fire_exit_plg( close_window = abap_true ).
ENDMETHOD.
Close Portal Window


Finally, make a call to this method from action handler method of Close button.
Share

2 comments:

  1. Well explained. Got to learn new things from your Blog on Appium.Appium training in chennai

    ReplyDelete
  2. Best sap MM and SD training with placement chennai
    http://thecreatingexperts.com/sap-mm-training-in-chennai/

    ReplyDelete

 
Copyright © 2015 Sap 4 All
Distributed By SAP 4 ALL |