cancel
Showing results for 
Search instead for 
Did you mean: 

refresh WDA2 on click of button in WDA1

Former Member
0 Kudos

Hi,

I have two web dynpro applications WDA1 and WDA2. On click of button in WDA1 , I want to navigate to the WDA2. Basically , I want to be directed to WDA2 and refresh it on click of button in WDA1.

for this in the window of the WDA1 , I am firing the exit plug and passing the URL of the WDA2 , using cl_wd_utilities=>construct_wd_url

reference :

http://wiki.sdn.sap.com/wiki/display/Snippets/Snipppets%2b%2bWeb%2bDynpro%2bABAP-%2bHow%2bto%2buse%2...

but I am not able to navigate and refresh WDA2, i can only see the URL of the WDA2 in the address bar but I also get the error page can not be displayed

please point me where am I missing . this is critically required in my development work.thanks in advance.

regards,

Amit

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

use exit plug in both the components and use the parameter URL for exit plug instead of LV_URL

Former Member
0 Kudos

hi,

I want WDA2 to open in the same window and replace the current application.Basically , on calling agin the WDA2 , I wanted to refresh it .

any help in this regard..

regards,

amit

Former Member
0 Kudos

Hi - In WDA1 have you declare the WDA2 as a Component_Usage?

if yes :

- go to WINDOW of WDA1

- embed the WINDOW of WBA2 to the WINDOW in WDA1

In WDA1:

- go back to the VIEW and on the button action create an outbound plug

- go to the WINDOW and connect the outbound plug to an inbound plug in the WDA2 window (the window that was embedded at the beginning.

In WDA2:

Set WDDOINIT to be active when VISIBLE not by Framework (it will run WDDOINIT everytime is visible to the user)

hope this help!

thanks!

Jason PV

Former Member
0 Kudos

Hi,

fine .. I will try ur solution

just one clarifiction before that , "do you mean to navigate to WDA2 on click of button in WDA1, I do not need to fire the exit plug and pass the URL of WDA2?''

only if I embed the window of WDA2 in WDA1 and fire the outbound plug , it will refresh the WDA2 , if lifetime property is set to "When Visible".

thnks for the reply ,

Amit

Former Member
0 Kudos

Hi,

just one clarifiction before that , "do you mean to navigate to WDA2 on click of button in WDA1, I do not need to fire the exit plug and pass the URL of WDA2?''

only if I embed the window of WDA2 in WDA1 and fire the outbound plug , it will refresh the WDA2 , if lifetime property is set to "When Visible".

Yes, there's no need to call EXIT PLUG neither the URL if you declare WDA2 as a component use of WDA1. Is very important to declare WDA2 as a component use of WDA1.

Outboud plug will automatically close WDA1 and WDDOINIT will run everytime WDA2 is visible to the user (user click button in WDA1 to navigate to WDA2).

Please let me know!

Jason PV

Former Member
0 Kudos

Amit - also dont forget to link the outbound plug from WDA1 with the inbound plug of WDA2 (in your window level of WDA1).....you need to DRAG OUTBOUND PLUG TO INBOUND PLUG and drop in the inbound plug it will create a LINK "communication" between the plugs.

Please let me know how everything goes.

thanks!

Jason PV

Former Member
0 Kudos

hi ,

I am friring the outbound plug to WDA2. in the WDA2,I am using the method

construct_wd_url but it and passing the application name, and using the application URL in the exit plug of the application , but I am getting a error"Page can not be displayed"

I am able to see the URL of the application in the address bar of the browser. Can any one help in this regard?

regards,

amit

ChrisPaine
Active Contributor
0 Kudos

Is the URL correct?

Can you normally launch WDA2 from this URL?

I'm sure you've already looked - but is WDA2 activated in SICF?

Former Member
0 Kudos

Hi Chris,

Thanks for the insight . WDA2 is activated in SICF and the URL which is generated in the address bar is correct.

The problem is that only URL is generated and the exeption occurs in the page and displayed as " Page can not be found".

I am not able to figure out , why this is happening . I have created a Exit plug inside the Window , and I am firing it in my view and passing the URL as parameter .


DATA:lr_ref TYPE REF TO IG_WIN_VENDORMGMTHOME,
      str    TYPE        string.  // here WIN_VENDORMGMTHOME is my window

*Get the URL of the Application

CALL METHOD cl_wd_utilities=>construct_wd_url

EXPORTING

    application_name = 'ZC_VENDORMANAGEMENT_HOME' // name of the application which i want to refresh

IMPORTING

   out_absolute_url = str.

*Reference of Window

lr_ref = wd_this->GET_WIN_VENDORMGMTHOME_CTR( ).

* Fire Exit Plug

lr_ref->FIRE_TO_HOME_REFRESH_PLG(

lv_url = str

).

where am I missing?

regards,

Amit

Former Member
0 Kudos

any pointers , pls help

TomVanDoo
Active Contributor
0 Kudos

see here:

remember: Web dynpro for abap is NOT like PHP or ASP

so you may not think in terms of webpages

instead you have to think in terms of components

Former Member
0 Kudos

Hi ,

I am able to navigate to WDA1. Now WDA1 is independent component. In WDA1 , I am calling construct_wd_url to refresh the component. But I am not able to do so ?

What can be the issue ?

regards,

Amit

Former Member
0 Kudos

Hi,

This is what i have written in onactionmethod( ).

Check it.


Data:
  V_string type string,
  Lo_window type ref to if_wd_window_manager,
  Lo_api type ref to if_wd_component,
  Wid_ref type ref to if_wd_window.

CALL METHOD cl_wd_utilities=>construct_wd_url
EXPORTING
    application_name = 'YH5_WDA_SALES' " Make sure it is in CAPITAL LETTERS
IMPORTING
   out_absolute_url = v_string.

Lo_api = wd_controller->wd_get_api( ).
Lo_window = lo_api_get_window_manager( ).

Wid_ref = lo_window->create_external_window(
 url = v_string
).
Wid_ref->open( ).

I hope it helps.

Regards and Best wishes.