cancel
Showing results for 
Search instead for 
Did you mean: 

FileDownload, downloading data from Server to Client/Share

Former Member
0 Kudos

Hello together,

my Web Dynpro Application shall save 4 Files to the client or to a share.

If the User presses SAVE DATA on the application, the data should be saved in a table (this is already done) but also the new and the old data should be saved in 4 Files on the client or share, without pressing any other Buttons or something else.

This new and old data are divided in 4 Files. I already did the file Download with a Button, and on the browser there comes a popup and i can save this files - > but this is not what it should.

Can somebody please HELP?

Regards Chris

Accepted Solutions (0)

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos
Former Member
0 Kudos

I don't get my Files downloaded.

Has sb. maybe experience with ACFUPDOWNLOAD?

With the tutorial i don't get the files I need downloaded?

Can sb. help?

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>With the tutorial i don't get the files I need downloaded?

I think before anyone can help you are going to have to be a little more specific when describing your problem.

Former Member
0 Kudos

Why do i have to set my Files to Cache?

I don't even uploaded sth. so it can be in sth. in the cache.

And what's

ZISLUPLD_FILE_LIST_TBL

for a table?

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>Why do i have to set my Files to Cache?

Because ACFUpDownload is designed for use with the KPRO/Cache Server. It isn't designed to communicate directly back to the Web Dynpro ABAP application. The ICF Handler Class and the Cache table are the ways to fake an external KPRO/Cache Server on the same ABAP stack and then transfer the updated back to the WDA user session. The Upload is done as a streaming upload into a separate work process of ICF handler and not the user session of the WDA application.

>And what's

ZISLUPLD_FILE_LIST_TBL

for a table?

That's a table type referenced in the code.

Former Member
0 Kudos

Another Question.

My Data now i have are in XSTRING -> done with function SCMS_STRING_TO_XSTRING

So how can i put them, with this method, into a File?

with attach_file_to_respons ( i_file = i_file_name......

it's really easy.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Its not as simple with ACFUpDownload becuase the Web Dynpro ABAP user session isn't the one hosting the download. It is streamed from the separate handler instance. In the WDA application you need to build a URL that points to the specific file. The file content needs to be placed into the cache table so that the handler class can serve it out when it receives the request from the ACFUpDownload Applet.

Former Member
0 Kudos

Can you tell me how i can place the content of the File to the cache Table?

Do they have to be of String or can i let them to XString?

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

How much of my example code are you using? Are you using the class ZCL_WDA_FISL_UPLOAD_HANDLER? It was primarily designed for uploading first and then downloading these files. You just need to extend it with another static method simliar to IMPORT_FILE_REQUEST. Instead of extracting the data out of the server request object, just pass the XSTRING of the content into the method as a parameter. The rest of the logic to insert the data into the cache table would stay the same.

Former Member
0 Kudos

Hmm this is a little bit to complicated for my application.

It is possible to start a Z Abap programm from a Web dynpro. So i would implement the downloading of the 4 Files to a programm and start it from the Web Dynpro?

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You can submit an ABAP program to the background, but it won't be able to access the client as a background job. You can try navigating to a SAPGUI for HTML (ITS) URl for the ABAP program and use it to download the files.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Remember you are in a web browser, not a desktop application. There is a security sandbox that protects the client machine from web browser access. The only way you are going to get slient downloads of multiple files in Web Dynpro is with the AcfUpDownload UI element in 7.01 and higher. It uses a signed Java Applet to get around the browser security sandbox.

You sya you need to write this to the clietn or to a share. Is the file share accessible from the file system of the ABAP application server? If so you might have a much easier time writing the files to the file share via normal ABAP Dataset commands. This won't involve the browser at all since the ABAP application server will write directly to the file share.

Former Member
0 Kudos

Thx alot for the Information.

You sya you need to write this to the clietn or to a share. Is the file share accessible from the file system of the ABAP application server?

This i have to try. Now I only want to save the files to my desktop.

Is there any tutorial to ACFUpDownload?

Regards Chris