cancel
Showing results for 
Search instead for 
Did you mean: 

Upload UI Element - Where is the uploaded files saved?

Former Member
0 Kudos

Hi All,

I have created a Web Dynpro Application that uploads a file. However, I don't know where the file is saved to?? I have had a look in the folders listed in AL11, but I wasn't able to find my file..

Where is the file saved to when uploading a file using FiledUpload UI Element??

Thanks, Johannes

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

File Upload UI element works in similar way as the GUI_UPLOAD works in ABAP.

It makes the file content availbale to the application to process.

When you use fileUIUpload element the content of the file uploaded is returned as a XSTRING. If you want to upload the file to app server you need to write code for it.

http://help.sap.com/saphelp_nw04s/helpdata/en/b3/be7941601b1d09e10000000a155106/frameset.htm

Thanks,

Abhishek

Answers (3)

Answers (3)

Former Member
0 Kudos

hi.

use upload UI element can't save file directly to your server .

upload UI element just upload your local file to element of contest that you defined web Dynpro component.

in here bind elements always typed XSTRING, so you also need convert logic .

if you want save file in server , coding from Open dataset ,transfer dataset ,and close dataset for handle .

that's all

Former Member
0 Kudos

Does anybody have examples of saving the xstring file on the app server?

Thanks, Johannes

Former Member
0 Kudos
data lv_output_length type i.
data ls_solix type solix-line.
data lt_solix_tab type table of solix-line.
data lv_filename type string.
data lv_docnum type doknr.

*write a temp file on app server

You can use the following code to create file on application server
* 1. create File name of the uploaded file on app server
concatenate '/usr/sap/' sy-sysid sy-uname sy-datum into lv_filename.

*2. convert xstring to binary : pass the XSTRING received from UI Upload element
call function 'SCMS_XSTRING_TO_BINARY'
exporting
buffer = lv_filesource " this is the XSTRING of the file u want to upload 
importing
output_length = lv_output_length
tables
binary_tab = lt_solix_tab.

* 3. write the file 
if not lt_solix_tab is initial.
open dataset lv_filename for output in binary mode.
loop at lt_solix_tab into ls_solix.
transfer ls_solix to lv_filename.
endloop.
close dataset lv_filename.
endif.

The file <Lv_filename> will be created on the app server.

Best Regards,

Radhika Vadher

Former Member
0 Kudos

Hi,

When I Uploaded a text ur code will works,But when I uploaded pdf or .xls files it is not working.Can u suggest other soluiton

Former Member
0 Kudos

To create .XLS file you will have to modify the code a bit, use something like below. Also the filename should have extension .xls

data: tab type x value 9,
htab(1) type c.
htab = cl_abap_char_utilities=>horizontal_tab.

open dataset .. 
loop at itab.
concatenate ITAB-field1 ITAB-field2 ITAB-field3 
into STRING separated by htab.

transfer ....
endloop.

Former Member
0 Kudos

HI,

File upload UI element is binded to the attribute of type xstring. when u will upload any file then it will get converted to xstring.

Now u can save this xstring data in database table with column of type raw.

Former Member
0 Kudos

You can save the the file in custom tables in XSTRING (TYPE RAW) format and using filedownload uielement these file can be retrieved back.