cancel
Showing results for 
Search instead for 
Did you mean: 

Button as UI Element for FileDownload

Former Member
0 Kudos

Hello,

I am to download data to an excel file. Herefore I can use the UI Element FileDownload (with supply function and such).

It woks fine.

Now the users would like to have the download being enabled via a button rather than a link.

So I created a button and thought that it should be possible to access the ui filedownload element via button action implementation and tell it (the filedownload ui) that it has been enabled. But I have not found a facility to neither access the filedownload UI element nor even to tell it that it is activated. I looked into the dynamic programming section of sap web dynpro documentation, but nothing seemd to fit.

Anybody got an idea if and if so how I could solve the 'problem'?

tx a lot in advance

Ana

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You don't want to try and use the FileDownload UI element at runtime in such a way. Instead use the CL_WD_RUNTIME_SERVICES=>Method ATTACH_FILE_TO_RESPONSE API method:

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

Answers (1)

Answers (1)

Former Member
0 Kudos

Dear Thomas,

thank you a lot, this was easy:-)

Just one question out of curiosity: Is it generally possible to influence the web dynpro abap UI elements in a way to simulate them being 'hit' without needing direct user interaction? I only found the possibility of deactivating or activating or make them visible/invisible using special contexts, but this is rather a different issue.

Tx a lot

Ana

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

It generally isn't necessary to "simulate" the action. You can instead directly call the controller event handler method for the action just as you would call any other method. The FileDownload UI element is a bit of a special case because of the necessary interaction between the client side and server side - hence the API to do so.

Former Member
0 Kudos

ok, thank you for the information!

Ana