on 02-18-2010 8:29 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can save the the file in custom tables in XSTRING (TYPE RAW) format and using filedownload uielement these file can be retrieved back.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.