cancel
Showing results for 
Search instead for 
Did you mean: 

Open a html file from desktop or from a different network location

0 Kudos

Hi experts,

I am new to webdynpro, so please kindly help me on this requirement. I am displaying list of data in a table in which each record is a link. when i click on the link, it should open a Html file in a new internet explorer, and the files may be in different network location also. How do i do it? please help me.

Regards,

Arun

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Implement the action of link. In this action handler, use the method WDR_TASK=>CLIENT_WINDOW->CLIENT->ATTACH_FILE_TO_RESPONSE()

Refer these link for the solution -

Regards,

Lekha.

0 Kudos

Hi Lekha

Thank you for the reply, but i dont want to download the document, instead i want to open the html file in a browser, simiraly like opening the URL, but the file is in the local drive.

Thank you,

Regards,

Arun

Former Member
0 Kudos

Hi,

In the Link to aciton handler, call the popup and open it in external window.

In the popup window parameter you can give the full path of the URL.

** GET WINDOW MANAGER
  l_cmp_api = wd_this->wd_get_api( ).
  IF l_cmp_api IS BOUND.
    l_window_manager = l_cmp_api->get_window_manager( ).

    IF l_window_manager IS BOUND.
      CALL METHOD l_window_manager->create_external_window
        EXPORTING
          url            = lv_url                    "Check this out.......Give full URL name 
          modal          = abap_false
          has_menubar    = abap_false
          is_resizable   = abap_true
          has_scrollbars = abap_false
          has_statusbar  = abap_false
          has_toolbar    = abap_false
          has_location   = abap_false
        RECEIVING
          window         = l_popup.
      l_popup->open( ).
    ENDIF.                               " IF l_window_manager IS BOUND
  ENDIF.                                 " IF l_cmp_api IS BOUND.

Hope this works.

Regards,

Lekha.

Edited by: Lekha on Oct 9, 2009 11:37 AM

0 Kudos

Hi Lekha,

i used the same coding but nohing is happening, the processing indicator is just running in the browser and no new window is opening,

please kindly help.

path = 'C:\Documents and Settings\xxxxx\Desktop'.

CONCATENATE path lv_zhol_pkg INTO lv_pack SEPARATED BY '\'.

CONCATENATE lv_pack 'htm' INTO lv_pack_res SEPARATED BY '.'.

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.

lo_api_component = wd_comp_controller->wd_get_api( ).

IF lo_api_component is BOUND .

lo_window_manager = lo_api_component->get_window_manager( ).

IF lo_window_manager is BOUND.

CALL METHOD lo_window_manager->CREATE_EXTERNAL_WINDOW

EXPORTING

URL = lv_pack_res

MODAL = ABAP_FALSE

HAS_MENUBAR = ABAP_FALSE

IS_RESIZABLE = ABAP_TRUE

HAS_SCROLLBARS = ABAP_FALSE

HAS_STATUSBAR = ABAP_FALSE

HAS_TOOLBAR = ABAP_FALSE

HAS_LOCATION = ABAP_FALSE

RECEIVING

WINDOW = lo_window.

lo_window->open( ).

endif.

endif.

regards,

Arun

Former Member
0 Kudos

Hi,

Do one thing...

I have created one html file and ran it in Explorer window (C:\Documents and Settings\8754\Desktop\test.html)

Same i passed to the below method

* Generate the url for the component
  CALL METHOD cl_wd_utilities=>construct_wd_url
    EXPORTING
      application_name = 'C:\Documents and Settings\c08390\Desktop\test.html'
    IMPORTING
      out_absolute_url = lv_url.

Now pass this URL to the popup window.

Try this out...

Regards,

Lekha.

Edited by: Lekha on Oct 9, 2009 12:34 PM

0 Kudos

Hi Lekha,

I coded the same way but still not opening the html, now it is opening new browser but i cannot see any page inside the browser, if i run the html file seperately it is working good.New parameter have got added in the URL, please help i got stuck

http://wltapp.xxxx.com:5000/sap/bc/webdynpro/sap/c:\documents and settings\XXXX\desktop\alpine club.htm

CALL METHOD cl_wd_utilities=>construct_wd_url

EXPORTING

application_name = 'c:\documents and settings\XXXX\desktop\alpine club.htm'

IMPORTING

out_absolute_url = lv_url.

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.

lo_api_component = wd_comp_controller->wd_get_api( ).

IF lo_api_component is BOUND .

lo_window_manager = lo_api_component->get_window_manager( ).

IF lo_window_manager is BOUND.

CALL METHOD lo_window_manager->CREATE_EXTERNAL_WINDOW

EXPORTING

URL = lv_url

MODAL = ABAP_TRUE

HAS_MENUBAR = ABAP_TRUE

IS_RESIZABLE = ABAP_TRUE

HAS_SCROLLBARS = ABAP_TRUE

HAS_STATUSBAR = ABAP_TRUE

HAS_TOOLBAR = ABAP_TRUE

HAS_LOCATION = ABAP_FALSE

RECEIVING

WINDOW = lo_window.

lo_window->open( ).

endif.

endif.

Former Member
0 Kudos

Try for a local file first then go for file on other server.

Check wether the browser is geting opened or not

0 Kudos

HI,

Yes it is a local file only, once i pass the local file url into construct url method, the url is getting changed like the one i provide above, the new browser is opened but it cannot find the link.

Thank you,

Regards,

Arun

Former Member
0 Kudos

Are you getting any error

0 Kudos

Hi,

No any error or anything, but i sorted out some how by creating the MIME object and importing the files and using the exporting paramter out_local_url in the construct url method, so if i pass the mime repository path, the file is opening without any problem.But wondering is there any way to open a file in the desktop in a new web browser. Lekha any inputs on this, it will be very helpful.

Thank you,

Regards,

Arun

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

It doesn't make any sense to use cl_wd_utilities=>construct_wd_url in this case. That is always going to try and append the server address to the front of the generated URL. That won't do anything for you. Have you tried just feeding the url 'file://
C:\Documents and Settings\c08390\Desktop\test.html'?

0 Kudos

Hi Thomas,

Have tried but ended up in Dump error, I tried to feed the below URL but ended up in error

file://
C:\Documents and Settings\xxxx\Desktop\New Folder\Wamo - 5K - Alpine Club, Nanital.htm

Regards,

Arun

Answers (0)