cancel
Showing results for 
Search instead for 
Did you mean: 

Open word/excell/pdf document from local drive using WD/ABAP

Former Member
0 Kudos

Hi,

I want to open a word/excell/pdf document in Web Dynpro ABAP.

I don't want to store the document in MIME due to some reasons.

Please let me know how this can be done.

Thanks

Sandeep

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Gurus,

I am not able to find a solution to this issue.

Requirement is simple. I have a file name which exists in Client machine or App server.

I need to open that file with it's appropriate application, The file name and it's application information is available to me.

Since I have the file name and I don't want to use the FileUpload or FileDownload UI's.

Your response will be highly appreciated.

Thanks,

Sandeep

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>Requirement is simple.

It sounds that way, but given the security sandbox nature of the web browser it is actually quite complicated. Web Browers are designed to allow web pages to run but not have direct access to the client's PC and File System. You can imagine what kind of malicious activity could take place if any website could directly access your file system or launch any application they wanted. These controls are in place to protect end users and all applications that run in a browser have to live with them.

Now in NetWeaver 7.01 and higher we have a new UI element called ACFExecute and ACFUpDownload. They use digitally signed Java Applets that bypass the Web Browser security model to allow such direct access to the filesystem and allow for the launching of application. This control is signed so that it can only be used by SAP applications and must be trusted on the client side. Also there is a security whitelist (XML file) that has to be maintained and pushed to the client machine which controls exactly which applications can be launched and which directories can have read and write access.

If you are on NetWeaver 7.01, then these new UI elements might be able to meet your needs. Here are some links to more information on these new UI elements:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/b91539878a2d67e10000000a42189c/frameset.htm

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/b9157c878a2d67e10000000a42189c/frameset.htm

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi Thomas,

Unfortunately we are not using Netweaver 7.10.

We are using ECC 6.0 version which doesn't has ACFExecute and ACFUpDownload UI's.

Let me know if it is possible in ECC 6.0 by applying some notes or patches. Thanks.

Regards

Sandeep

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> Hi Thomas,

>

> Unfortunately we are not using Netweaver 7.10.

> We are using ECC 6.0 version which doesn't has ACFExecute and ACFUpDownload UI's.

>

> Let me know if it is possible in ECC 6.0 by applying some notes or patches. Thanks.

>

> Regards

> Sandeep

I never said NetWeaver 7.10. I said NetWeaver 7.01. Those are two very different things. You can get NetWeaver 7.01 on ECC 6.0 by applying ECC 6.0 Enhancement Package 4. This ERP Enhancement Package will also update your NetWeaver layer from NetWeaver 7.0 to NetWeaver 7.0 Enhancement Package 1 (7.01). You would then have these new UI elements.

However in the email that you sent me directly you stated that the files were available via the Application Server file system:

>Secondly the file is available Server and I don't want(probably not possible) to uploaded it in the MIME.

If this is the case, then you don't need these UI elements at all. You need only read the files from the ABAP Application Server Filesystem using the DATASET commands. This will bring the file contents into memory on ABAP. You don't have to place them into the MIME Repository. Once in memory in ABAP you can push the content with the response object. You can have a linkToAction and in the action handler - read the file from the filesystem, and push it out. The following code (which is taken from SAP Press Book - Next Generation ABAP Development) gives an example:

data dot_offset type i.
  data extension type mimetypes-extension.
  data mimetype type mimetypes-type.

  " Find out file name extension
  find first occurrence of regex '\.[^\.]+$'
    in stru_course_ass_att-filename match offset dot_offset.
  add 1 to dot_offset.
  extension = stru_course_ass_att-filename+dot_offset.
  " Get mime type
  call function 'SDOK_MIMETYPE_GET'
    exporting
      extension = extension
    importing
      mimetype  = mimetype.

  data l_mimetype type string.
  l_mimetype = mimetype.
  cl_wd_runtime_services=>attach_file_to_response(
      i_filename      = stru_course_ass_att-filename
      i_content       = stru_course_ass_att-content
      i_mime_type     = l_mimetype
*    i_in_new_window = abap_false
*    i_inplace       = abap_false
         ).

Former Member
0 Kudos

Hi Thomas,

Thanks for you valuable inputs.

Writing NetWeaver 7.10 was the typo.

The problem is solved. Thanks very much again.

Regards

Sandeep

uday_gubbala2
Active Contributor
0 Kudos

Hi Sandy,

You should check [Thomas Jung's replies|; to Stpehan in this thread. Stephan too wanted to access some software on the clients machine through WDA.... Hope this helps answer your query.

Regards,

Uday

Former Member
0 Kudos

Is there a way to get the contents in the file without using FileUpload UI

Former Member
0 Kudos

Maybe WDR_Test_Events, Views: FileDownload, FileUpload may help.

And for completeness, see:

Rgrds....

Former Member
0 Kudos

I don't find any WD Component or Application that opens any of the files... more help please...

Former Member
0 Kudos

Hi Lekha,

Would be greatefull if you could give some detailed steps.

Thanks

Former Member
0 Kudos

Sandy,

I can help with that for WDA wdr_test_ui_elements ....

-SE80

-package SWDP

-Embedded Packages

-SWDP_Test

-Web Dynpro

-Web Dynpro Components (has code), or Web Dynpro Applicat. (no code, only WDA)

The applications are listed in alpha order.

I hope that this helps,

Dan P.

Former Member
0 Kudos

Hi,

Use the UI ACFEXECUTE or ACFUPDOWNLOAD that are in latest versions or Use the UI element FileUpload/Download .

check the standard example wdr_test_ui_elements.

Regards,

Lekha.