cancel
Showing results for 
Search instead for 
Did you mean: 

Access window controller instance in view method

Former Member
0 Kudos

Hi,

The following code was given in help.sap.com to fire a window exit plug from a view method.

method ONACTIONGO_EXIT .

data: L_REF_MAIN_WINDOW type ref to IG_MAIN_WINDOW .

L_REF_MAIN_WINDOW = WD_THIS->GET_MAIN_WINDOW_CTR( ).

L_REF_MAIN_WINDOW->FIRE_MY_EXIT_PLUG_PLG(

URL = 'http://www.sap.com' " String

).

endmethod.

(http://help.sap.com/saphelp_nw70/helpdata/en/45/1bc575ba064574e10000000a114a6b/frameset.htm)

My application details

View name - VW_APPLWIZARD

Window name - WDW_REG_APPLWZD

Window Intf. - IG_WDW_REG_APPLWZD

The code in my view method should look something like this,

data: l_main type ref to IG_WDW_REG_APPLWZD.

l_main = wd_this->get_wdw_reg_applwzd_ctr( ).

l_main->fire_exit.....

wd_this doesn't contain any method like get_wdw_reg_applwzd_ctr to get the window controller instance. All i could find is, wd_get_api (from getting the view controller) and get_componentcontroller_ctr (to get the view component controller). Can somebody help me understand the example code?

Message was edited by:

Venky

Accepted Solutions (1)

Accepted Solutions (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi Venkatesh

Add The Window controller in the Properties tab of the View.

Regards

Abhimanyu L

Answers (1)

Answers (1)

thanosefraimidis
Discoverer
0 Kudos

Need to declare your "view" to "use" your "window".

Using sapgui:

In SE80 select your "view" at LHS.

Click "Properties" tab at RHS - click icon "Create Controller Usage" (it is above the "Used Controllers/Components" table), select your "window" and save (make sure your "window" appears in the table).

Click "Attributes" tab at RHS - double-click the "IF_<viewname>" table cell (row "WD_THIS", column "Associated Type"). This displays the "IF_<viewname>" interface which now contains the "get_<windowname>_ctr" method.