cancel
Showing results for 
Search instead for 
Did you mean: 

Examples of using exit plug

Former Member
0 Kudos

Hi there,

I am launching a WD app via the portal UWL. I'm using the action handler "SAPWebDynproABAPlauncher" and launching the app in a new window via the "launchinNewWindow" parameter.

What I'm trying to achieve is being able exit this WD app and launch a new WD app.

I've been advised to use an exit plug in the calling WD app but I'm trying to find a working example of how to code this as I obviously need to be able to construct the URL for the new WD app and somehow pass this URL as part of the exit plug?

I'm aware the exit plug needs to be defined as an interface outbound plug of the WD components' window but I'm stuck when it comes to how the firing of the exit plug and construction of the URL should be coded.

Any help would be greatly appreciated.

Michael

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks guys - I didn't realise it was that straight forward.

One last question do I need to be in the context of a view to be able to fire the exit plug?

I want the exit plug firing and launching to be automatic so I have placed a Timed trigger UI element in the view to call an action to fire the plug. Ideally I'd like to be able to fire the exit plug from the WDDOINIT method of the component controller but I get an error when I try to do that so I'm assuming I need to be in the context of a view to be able to fire an exit plug?

Michael

ChrisPaine
Active Contributor
0 Kudos

Hi Michael,

I'm not sure I understand your last question. Do you want to immediately close and exit app1 whilst launching app2.

Are you using app1 as some sort of redirect application?

As you mention that you are using the UWL - I'm guessing you're running within a portal?

In which case you could also use the portal navigation API which I believe can be fired from anywhere.

The good thing about this is that you can easily make it relative - easier to migrate through various development environments. But I guess that also depends on whether the app2 is indeed anothe WD app, whether you want to access it through the portal, use different authentication etc.

eg:

data lo_api_component  type ref to if_wd_component.
data lo_portal_manager type ref to if_wd_portal_integration.

lo_api_component = wd_comp_controller->wd_get_api( ).
lo_portal_manager = lo_api_component->get_portal_manager( ).

call method lo_portal_manager->navigate_absolute
  exporting
    navigation_target   = 'http://www.google.com'
    navigation_mode     = IF_WD_PORTAL_INTEGRATION=>CO_SHOW_EXTERNAL
*    window_features     =
*    window_name         =
*    history_mode        = IF_WD_PORTAL_INTEGRATION=>CO_NO_DUPLICATES
*    target_title        =
*    context_url         =
*    post_parameters     = ABAP_FALSE
*    use_sap_launcher    = ABAP_TRUE
*    business_parameters =
*    launcher_parameters =
    .

hope it helps,

Cheers,

Chris

Former Member
0 Kudos

Hey there Chris,

Good to meet you the other day in Sydney.

Yes you are correct I'm using app1 as a redirect to app2 the main reason for this is so I can have a single task definition pointing to a single WD app in the UWL XML file but then redirecting to another WD app via some configuration.

I've tried the portal_manager->navigate_absolute method to redirect but I get a 'Page not found' error. Interestingly if i specify an external url address it works fine but any WD app generated URL doesn't work.

I can fire an exit plug passing the WD app URL and it works fine but the portal_manager navigation method seems to want to llink back to a portal page?

Michael

ChrisPaine
Active Contributor
0 Kudos

Hi Michael,

I'd suggest that the easiest solution here is to point to a portal location.

use the "ROLES://portal_content/...."

format for your target. Exactly as per configuring the HPF resources. And just create the page in your users role as an item that does not show up in navigation.

The good thing about this is that you will also get the protection of the portal permissions layer. The bad thing about this is that you will also get the protection of the portals permissions layer and you'll have to consider and build it. - But you do get the portal session handling - which is nice. And given you're already in the portal - and some of the apps you are pointing people to might already live there so it would be nice if users were shown where in the portal they lived.

edit: and the portal nav functionality is really for just that - so I can sort of understand it wanting a portal page/link to a role.

Hope that's helpful,

Cheers,

Chris

Edited by: Chris Paine on Mar 31, 2010 12:29 PM

Former Member
0 Kudos

Do the following steps :

-> Make an Outbound Plug to the Window.

->Make the type of Outbound plug to Exit Type.

->Add URL of type String as a parameter to the outbound plug of Window.

-> Add CLOSE_WINDOW of type wdy_boolean as a paramerter to the outbound plug of window.

->Do remember to add Component Name in the Properties Tab of View ( othervs Calling Outbound plug of window from view wont b possible ).

To open a new URL with closing the previous one write this Code in OnAction of Button : ( this Code can be get from Code Wizard too ).

DATA lo_zexit TYPE REF TO ig_zexit . <zexit is name of my window>
lo_zexit = wd_this->get_zexit_ctr( ).

lo_zexit->fire_out_window_plg(
url = 'http://www.google.com' " string
close_window = 'X'
).

Refer the SAP Online help :

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/48/ca3351508f04e7e10000000a42189c/content.htm

To get the URL of the new appliction , use this code :

data str type string.
CALL METHOD cl_wd_utilities=>construct_wd_url
  EXPORTING
    application_name              = 'Z102044_BAPI'
    IMPORTING
      out_absolute_url              = str.

The variable str would have the URL of the application.

arjun_thakur
Active Contributor
0 Kudos

Hi Michael,

Refer this article [Using Exit Plug in Web Dynpro for ABAP|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/d0018077-f0c9-2b10-87af-eb9bb40776d4&overridelayout=true].

Hope it helps