cancel
Showing results for 
Search instead for 
Did you mean: 

Call a methode without opening the main view

Former Member
0 Kudos

Hi,

I have a function that calls a web dynpro application. The handledefault methode of the window from this web dynproapplication searches for a url of a picture and opens it with my browser.

This works well.

But there are two windows open: my picture and the empty web dynpro main view.

How can I stop this? I just want the window with my picture.

Thanks,

Martina.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

thanks for your fast answers.

I tried both, the UI frame and a outbound plug.

But both doesn't work

My function checks out a picture of our database and creats a url.

At my webdynpro applicatin I use this methode:

CALL METHOD lo_window_manager->create_external_window
      EXPORTING
        url    = ld_url
      RECEIVING
        window = lo_window.

    lo_window->open( ).

If i create an exit outbond plug and fire this exti outbound plug after the code above the window with my picture doesn't open, too. Another problem whit the exit outbound plug is that he only exit the web dynpro application not the whole browser tab.

If I create an UI frame and reference this frame with an attribute with my url the UI frame opens a second window with the picture and at the first window i can se a empty UI frame.

Are there any other ideas?

Thank you very much!

Martina

manigandan_d2
Explorer
0 Kudos

Hi Martin ,

Based on my under standing. you have the function to call the WD application. through (In handle default) that you trying yo call the new URL for the Photo from the data base.

But you are getting the Two output

One "Photo"

Second "Empty View"

Solution:

Try to check the WD window having any default view.

If yes please unchecked it.

else: please sent the snap shot of your codding to me i will try to help

Best Regards,

Manigandaan D

Former Member
0 Kudos

Hi Manigandaan,

I deleted the empty main view from the webdynpro window.

But the result is always the same:

1 empty window and

1 window with my url

this is the code in the handledefault (after the data declaration):

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.
   DATA ld_url            TYPE          string.

   lo_api_component  = wd_comp_controller->wd_get_api( ).
   lo_window_manager = lo_api_component->get_window_manager( ).

ld_url = lv_doclink.

  data lo_api_controller type ref to if_wd_view_controller.
  data lo_window_ctlr TYPE REF TO if_wd_window_controller.

  lo_api_controller = wd_this->wd_get_api( ).
  lo_window_ctlr = lo_api_controller->GET_EMBEDDING_WINDOW_CTLR( ).

* get the control for window to be closed
  lo_window = lo_window_ctlr->get_window( ).

* this will close the window
  lo_window->close( delete_window = abap_true ).

if the ld_url is i.e. 'http://www.google.com' I get one browser window with google and another

browser window which is empty. The URL of this empty browser window is the url with which

i called the web dynpro application. But I don't need this window, how can I avoid this?

Thank you very much!!!

Martina

Former Member
0 Kudos

Hi gerle,

Try to open the URL of the picture in the same webdynpro component by using IFrame Ui element.

You can also try to close the window by firing the EXIT plug of the Window.

former_member184578
Active Contributor
0 Kudos

Hi Gerele,

I think you are using CL_WD_RUNTIME_SERVICES=>attach_file_to_response method to display image, which shows in new window.

One work around is, after calling this method, close the main window using exit plug.

check this reference: [Using Exit plug in WDA|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0018077-f0c9-2b10-87af-eb9bb40776d4?QuickLink=index&overridelayout=true]

Hope this helps u.,

Thanks & Regards,

Kiran.